diff --git a/rust/src/game/mod.rs b/rust/src/game/mod.rs index 0a8fa01..a29db99 100644 --- a/rust/src/game/mod.rs +++ b/rust/src/game/mod.rs @@ -836,7 +836,7 @@ impl Game { if let Some(character) = &mut character { character.dyn_bind_mut().new_buff(Buff { - time_remaining: 5., + time_remaining: self.opts.get_float(GameOption::SpawnProtection), kind: BuffKind::SpawnProtection, }); @@ -906,7 +906,7 @@ impl Game { if let Some(player) = self.players.iter_mut().find(|p| p.id() == id) { if let Some(mut character) = player.character.clone() { character.dyn_bind_mut().new_buff(Buff { - time_remaining: 5., + time_remaining: self.opts.get_float(GameOption::SpawnProtection), kind: BuffKind::SpawnProtection, }); diff --git a/rust/src/game/opts.rs b/rust/src/game/opts.rs index 4375067..07efeae 100644 --- a/rust/src/game/opts.rs +++ b/rust/src/game/opts.rs @@ -15,6 +15,7 @@ impl Default for GameOptions { opts.insert(GameOption::FriendlyFire, GameOptionValue::Boolean(true)); opts.insert(GameOption::GoalsNeededToWin, GameOptionValue::Number(5.)); opts.insert(GameOption::RespawnTimer, GameOptionValue::Number(5.)); + opts.insert(GameOption::SpawnProtection, GameOptionValue::Number(5.)); opts.insert( GameOption::TelegrenadesAllowed, GameOptionValue::Boolean(true), @@ -63,6 +64,8 @@ pub enum GameOption { TelegrenadesAllowed, /// How long in seconds does it take for a player to respawn RespawnTimer, + /// How long in seconds is spawn protected + SpawnProtection, } impl ToString for GameOption { @@ -74,6 +77,7 @@ impl ToString for GameOption { GameOption::GoalsNeededToWin => "Goals needed to win", GameOption::TelegrenadesAllowed => "Telegrenades allowed", GameOption::RespawnTimer => "Respawn Time (seconds)", + GameOption::SpawnProtection => "Spawn Protection", } .to_owned() }