diff --git a/src/server/defs.h b/src/server/defs.h index cdbd5ed..83a467c 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -67,6 +67,7 @@ var string autocvar_motdfile = "motd.txt"; var int autocvar_mp_friendlyfire = FALSE; /* new, FreeCS exclusive variables */ +var int autocvar_fcs_escapepenalty = -300; var int autocvar_fcs_swaponround = 0; var int autocvar_fcs_voxannounce = FALSE; var int autocvar_fcs_knifeonly = FALSE; /* Disallows buying and spawning with weps */ diff --git a/src/server/func_escapezone.qc b/src/server/func_escapezone.qc index 5053d8d..00c9a86 100644 --- a/src/server/func_escapezone.qc +++ b/src/server/func_escapezone.qc @@ -52,7 +52,10 @@ void func_escapezone::Touch(entity eToucher) { CSMultiplayerRules rule = (CSMultiplayerRules)g_grMode; - int to_escape = g_cs_total_t; + int to_escape = 0; + + rule.CountPlayers(); + to_escape = g_cs_total_t; /* only 3 Ts need to escape, max */ if (to_escape > 3) @@ -72,6 +75,17 @@ func_escapezone::Touch(entity eToucher) rule.m_iEscapedTerrorists++; + /* balancing tweak: for every escaped T, each and every CT will lose funds */ + if (autocvar_fcs_escapepenalty != 0) { + for (entity eFind = world; (eFind = find(eFind, ::classname, "player"));) { + player ct = (player)eFind; + + if (ct.team == TEAM_CT) { + Money_AddMoney(ct, autocvar_fcs_escapepenalty); + } + } + } + /* mark player as spectator for the end of this 'round' */ pl.MakeTempSpectator();