Skip to content

Commit 532c132

Browse files
afwn90cj93201nixr2e1reshel
andauthored
Add more flags for round time expired to CVar mp_round_infinite.
Co-authored-by: shel <[email protected]>
1 parent 36b46bf commit 532c132

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
3939
| mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams.<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round |
4040
| mp_buytime | 1.5 | 0.0 | - | Designate the desired amount of buy time for each round. (in minutes)<br />`-1` means no time limit<br />`0` disable buy |
4141
| mp_maxmoney | 16000 | 0 | `999999` | The maximum allowable amount of money in the game |
42-
| mp_round_infinite | 0 | 0 | 1 | Flags for fine grained control (choose as many as needed)<br/>`0` disabled<br/>`1` enabled<br/><br/>or flags<br/>`a` block round time round end check<br/>`b` block needed players round end check<br/>`c` block VIP assassination/success round end check<br/>`d` block prison escape round end check<br/>`e` block bomb round end check<br/>`f` block team extermination round end check<br/>`g` block hostage rescue round end check<br/><br/>`Example setting:` "ae" blocks round time and bomb round end checks |
42+
| mp_round_infinite | 0 | 0 | 1 | Flags for fine grained control (choose as many as needed)<br/>`0` disabled<br/>`1` enabled<br/><br/>or flags<br/>`a` block round time round end check<br/>`b` block needed players round end check<br/>`c` block VIP assassination/success round end check<br/>`d` block prison escape round end check<br/>`e` block bomb round end check<br/>`f` block team extermination round end check<br/>`g` block hostage rescue round end check<br/>`h` block VIP assassination/success round time end check<br/>`i` block prison escape round time end check<br/>`j` block bomb round time end check<br/>`k` block hostage rescue round time end check<br/><br/>`Example setting:` "ae" blocks round time and bomb round end checks |
4343
| mp_roundover | 0 | - | - | The round by expired time will be over, if on a map it does not have the scenario of the game.<br/>`0` disabled<br/>`1` enabled |
4444
| mp_round_restart_delay | 5 | - | - | Number of seconds to delay before restarting a round after a win. |
4545
| mp_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls.<br/>`0` disabled<br/>`1` enabled |

dist/game.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ mp_maxmoney 16000
3333
// 1 - enabled (never end round)
3434
//
3535
// Flags for fine grained control (choose as many as needed)
36-
// a - block round time round end check
36+
// a - block round time round end check, contain "h", "i", "j", "k" flags
3737
// b - block needed players round end check
3838
// c - block VIP assassination/success round end check
3939
// d - block prison escape round end check
4040
// e - block bomb round end check
4141
// f - block team extermination round end check
4242
// g - block hostage rescue round end check
43+
// h - block VIP assassination/success round time end check
44+
// i - block prison escape round time end check
45+
// j - block bomb round time end check
46+
// k - block hostage rescue round time end check
4347
//
4448
// Example setting: "ae" - blocks round time and bomb round end checks
4549
// Default value: "0"

regamedll/dlls/gamerules.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,18 @@ enum
191191
// custom enum
192192
enum
193193
{
194-
SCENARIO_BLOCK_TIME_EXPRIRED = BIT(0), // flag "a"
195-
SCENARIO_BLOCK_NEED_PLAYERS = BIT(1), // flag "b"
196-
SCENARIO_BLOCK_VIP_ESCAPE = BIT(2), // flag "c"
197-
SCENARIO_BLOCK_PRISON_ESCAPE = BIT(3), // flag "d"
198-
SCENARIO_BLOCK_BOMB = BIT(4), // flag "e"
199-
SCENARIO_BLOCK_TEAM_EXTERMINATION = BIT(5), // flag "f"
200-
SCENARIO_BLOCK_HOSTAGE_RESCUE = BIT(6), // flag "g"
194+
SCENARIO_BLOCK_TIME_EXPRIRED = BIT(0), // flag "a"
195+
SCENARIO_BLOCK_NEED_PLAYERS = BIT(1), // flag "b"
196+
SCENARIO_BLOCK_VIP_ESCAPE = BIT(2), // flag "c"
197+
SCENARIO_BLOCK_PRISON_ESCAPE = BIT(3), // flag "d"
198+
SCENARIO_BLOCK_BOMB = BIT(4), // flag "e"
199+
SCENARIO_BLOCK_TEAM_EXTERMINATION = BIT(5), // flag "f"
200+
SCENARIO_BLOCK_HOSTAGE_RESCUE = BIT(6), // flag "g"
201+
SCENARIO_BLOCK_VIP_ESCAPE_TIME = BIT(7), // flag "h"
202+
SCENARIO_BLOCK_PRISON_ESCAPE_TIME = BIT(8), // flag "i"
203+
SCENARIO_BLOCK_BOMB_TIME = BIT(9), // flag "j"
204+
SCENARIO_BLOCK_HOSTAGE_RESCUE_TIME = BIT(10), // flag "k"
205+
201206
};
202207

203208
// Player relationship return codes

regamedll/dlls/multiplay_gamerules.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,23 +2980,30 @@ void CHalfLifeMultiplay::CheckRoundTimeExpired()
29802980
}
29812981
#endif
29822982

2983+
#ifdef REGAMEDLL_ADD
2984+
int scenarioFlags = UTIL_ReadFlags(round_infinite.string);
2985+
#else
2986+
// the icc compiler will cut out all of the code which refers to it
2987+
int scenarioFlags = 0;
2988+
#endif
2989+
29832990
// New code to get rid of round draws!!
2984-
if (m_bMapHasBombTarget)
2991+
if (!(scenarioFlags & SCENARIO_BLOCK_BOMB_TIME) && m_bMapHasBombTarget)
29852992
{
29862993
if (!OnRoundEnd_Intercept(WINSTATUS_CTS, ROUND_TARGET_SAVED, GetRoundRestartDelay()))
29872994
return;
29882995
}
2989-
else if (UTIL_FindEntityByClassname(nullptr, "hostage_entity"))
2996+
else if (!(scenarioFlags & SCENARIO_BLOCK_HOSTAGE_RESCUE) && UTIL_FindEntityByClassname(nullptr, "hostage_entity"))
29902997
{
29912998
if (!OnRoundEnd_Intercept(WINSTATUS_TERRORISTS, ROUND_HOSTAGE_NOT_RESCUED, GetRoundRestartDelay()))
29922999
return;
29933000
}
2994-
else if (m_bMapHasEscapeZone)
3001+
else if (!(scenarioFlags & SCENARIO_BLOCK_PRISON_ESCAPE_TIME) && m_bMapHasEscapeZone)
29953002
{
29963003
if (!OnRoundEnd_Intercept(WINSTATUS_CTS, ROUND_TERRORISTS_NOT_ESCAPED, GetRoundRestartDelay()))
29973004
return;
29983005
}
2999-
else if (m_bMapHasVIPSafetyZone)
3006+
else if (!(scenarioFlags & SCENARIO_BLOCK_VIP_ESCAPE_TIME) && m_bMapHasVIPSafetyZone)
30003007
{
30013008
if (!OnRoundEnd_Intercept(WINSTATUS_TERRORISTS, ROUND_VIP_NOT_ESCAPED, GetRoundRestartDelay()))
30023009
return;

0 commit comments

Comments
 (0)