mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add pit spawn points #34
This commit is contained in:
@@ -376,7 +376,7 @@ fn default_rotation() -> GameEventSequence {
|
||||
auto_heal: true,
|
||||
},
|
||||
multiplayer: GameEvent {
|
||||
map: GameMap::Neptune3,
|
||||
map: GameMap::Earth1,
|
||||
visibility: GameVisibility::Good,
|
||||
mode: GameType::Pit,
|
||||
auto_heal: true,
|
||||
|
||||
@@ -385,21 +385,30 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
fn maps(&self) -> std::collections::HashMap<super::GameMap, super::MapConfig> {
|
||||
self.battle.maps.map.iter().map(|(map, conf)| {
|
||||
let mut spawns = std::collections::HashMap::<u8, Vec<super::Point>>::with_capacity(2); // usually 2 teams
|
||||
let mut pit_spawns = Vec::default();
|
||||
for point in conf.spawn_points.iter() {
|
||||
if let Some(list) = spawns.get_mut(&point.team) {
|
||||
list.push(super::Point {
|
||||
x: point.x,
|
||||
y: point.y,
|
||||
z: point.z,
|
||||
});
|
||||
if let Some(point_team) = &point.team {
|
||||
if let Some(list) = spawns.get_mut(point_team) {
|
||||
list.push(super::Point {
|
||||
x: point.x,
|
||||
y: point.y,
|
||||
z: point.z,
|
||||
});
|
||||
} else {
|
||||
let mut list = Vec::with_capacity(10); // usually 10 spawn points (suddent death has the most)
|
||||
list.push(super::Point {
|
||||
x: point.x,
|
||||
y: point.y,
|
||||
z: point.z,
|
||||
});
|
||||
spawns.insert(*point_team, list);
|
||||
}
|
||||
} else {
|
||||
let mut list = Vec::with_capacity(10); // usually 10 spawn points (suddent death has the most)
|
||||
list.push(super::Point {
|
||||
pit_spawns.push(super::Point {
|
||||
x: point.x,
|
||||
y: point.y,
|
||||
z: point.z,
|
||||
});
|
||||
spawns.insert(point.team, list);
|
||||
}
|
||||
}
|
||||
let bases = conf.bases.iter().map(|base| (base.team, (super::Sphere {
|
||||
@@ -425,6 +434,7 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
};
|
||||
let map_conf = super::MapConfig {
|
||||
spawns,
|
||||
pit_spawns,
|
||||
bases,
|
||||
capture_points,
|
||||
equalizer,
|
||||
|
||||
@@ -360,6 +360,7 @@ pub struct Sphere {
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct MapConfig {
|
||||
pub spawns: std::collections::HashMap<u8, Vec<Point>>, // team -> points
|
||||
pub pit_spawns: Vec<Point>,
|
||||
pub bases: std::collections::HashMap<u8, (Sphere, f32)>, // team -> (base, capture speed)
|
||||
pub capture_points: Vec<(Sphere, f32)>, // (capture point, capture speed)
|
||||
pub equalizer: Point,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user