Skip to content

Commit

Permalink
SoldierBomb: Prevent explosion right after the bomb placed
Browse files Browse the repository at this point in the history
Configurable via 'inf_double_click_filter_ms' (140 ms by default).
  • Loading branch information
Kaffeine committed Apr 26, 2024
1 parent bcdbbe2 commit 068bb2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game/server/infclass/entities/soldier-bomb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ CSoldierBomb::~CSoldierBomb()

void CSoldierBomb::Explode()
{
if(Server()->Tick() < m_StartTick + Config()->m_InfDoubleClickFilterMs * Server()->TickSpeed() / 1000.0)
return;

CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
if(!pOwnerChar)
return;
Expand Down
1 change: 1 addition & 0 deletions src/game/server/infclass/infc_config_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ MACRO_CONFIG_INT(InfSmokerHookDamage, inf_smoker_hook_damage, 2, 1, 10000, CFGFL
MACRO_CONFIG_INT(InfSpiderCatchHumans, inf_spider_catch_humans, 1, 0, 1, CFGFLAG_SERVER, "Always catch humans with hook")
MACRO_CONFIG_INT(InfInfzoneFreezeDuration, inf_infzone_freeze_duration, 2, 0, 10000, CFGFLAG_SERVER, "For how long infection zone will freeze humans (in seconds) (0 = disable)")
MACRO_CONFIG_INT(InfLastEnforcerTimeMs, inf_last_enforcer_time_ms, 400, 0, 10000, CFGFLAG_SERVER, "For how long the last hooker will be forced as the char indirect killer (in ms)")
MACRO_CONFIG_INT(InfDoubleClickFilterMs, inf_double_click_ms, 140, 0, 10000, CFGFLAG_SERVER, "")

MACRO_CONFIG_INT(InfProbaSmoker, inf_proba_smoker, 20, 0, 100, CFGFLAG_SERVER, "Probability for an infected to be a smoker")
MACRO_CONFIG_INT(InfProbaHunter, inf_proba_hunter, 20, 0, 100, CFGFLAG_SERVER, "Probability for an infected to be a hunter")
Expand Down

0 comments on commit 068bb2b

Please sign in to comment.