Skip to content

Commit

Permalink
Add more flags for round time expired to CVar mp_round_infinite.
Browse files Browse the repository at this point in the history
Co-authored-by: shel <[email protected]>
  • Loading branch information
afwn90cj93201nixr2e1re and shel authored Jun 13, 2020
1 parent 36b46bf commit 532c132
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams.<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round |
| 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 |
| mp_maxmoney | 16000 | 0 | `999999` | The maximum allowable amount of money in the game |
| 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 |
| 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 |
| 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 |
| mp_round_restart_delay | 5 | - | - | Number of seconds to delay before restarting a round after a win. |
| mp_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls.<br/>`0` disabled<br/>`1` enabled |
Expand Down
6 changes: 5 additions & 1 deletion dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ mp_maxmoney 16000
// 1 - enabled (never end round)
//
// Flags for fine grained control (choose as many as needed)
// a - block round time round end check
// a - block round time round end check, contain "h", "i", "j", "k" flags
// b - block needed players round end check
// c - block VIP assassination/success round end check
// d - block prison escape round end check
// e - block bomb round end check
// f - block team extermination round end check
// g - block hostage rescue round end check
// h - block VIP assassination/success round time end check
// i - block prison escape round time end check
// j - block bomb round time end check
// k - block hostage rescue round time end check
//
// Example setting: "ae" - blocks round time and bomb round end checks
// Default value: "0"
Expand Down
19 changes: 12 additions & 7 deletions regamedll/dlls/gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,18 @@ enum
// custom enum
enum
{
SCENARIO_BLOCK_TIME_EXPRIRED = BIT(0), // flag "a"
SCENARIO_BLOCK_NEED_PLAYERS = BIT(1), // flag "b"
SCENARIO_BLOCK_VIP_ESCAPE = BIT(2), // flag "c"
SCENARIO_BLOCK_PRISON_ESCAPE = BIT(3), // flag "d"
SCENARIO_BLOCK_BOMB = BIT(4), // flag "e"
SCENARIO_BLOCK_TEAM_EXTERMINATION = BIT(5), // flag "f"
SCENARIO_BLOCK_HOSTAGE_RESCUE = BIT(6), // flag "g"
SCENARIO_BLOCK_TIME_EXPRIRED = BIT(0), // flag "a"
SCENARIO_BLOCK_NEED_PLAYERS = BIT(1), // flag "b"
SCENARIO_BLOCK_VIP_ESCAPE = BIT(2), // flag "c"
SCENARIO_BLOCK_PRISON_ESCAPE = BIT(3), // flag "d"
SCENARIO_BLOCK_BOMB = BIT(4), // flag "e"
SCENARIO_BLOCK_TEAM_EXTERMINATION = BIT(5), // flag "f"
SCENARIO_BLOCK_HOSTAGE_RESCUE = BIT(6), // flag "g"
SCENARIO_BLOCK_VIP_ESCAPE_TIME = BIT(7), // flag "h"
SCENARIO_BLOCK_PRISON_ESCAPE_TIME = BIT(8), // flag "i"
SCENARIO_BLOCK_BOMB_TIME = BIT(9), // flag "j"
SCENARIO_BLOCK_HOSTAGE_RESCUE_TIME = BIT(10), // flag "k"

};

// Player relationship return codes
Expand Down
15 changes: 11 additions & 4 deletions regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2980,23 +2980,30 @@ void CHalfLifeMultiplay::CheckRoundTimeExpired()
}
#endif

#ifdef REGAMEDLL_ADD
int scenarioFlags = UTIL_ReadFlags(round_infinite.string);
#else
// the icc compiler will cut out all of the code which refers to it
int scenarioFlags = 0;
#endif

// New code to get rid of round draws!!
if (m_bMapHasBombTarget)
if (!(scenarioFlags & SCENARIO_BLOCK_BOMB_TIME) && m_bMapHasBombTarget)
{
if (!OnRoundEnd_Intercept(WINSTATUS_CTS, ROUND_TARGET_SAVED, GetRoundRestartDelay()))
return;
}
else if (UTIL_FindEntityByClassname(nullptr, "hostage_entity"))
else if (!(scenarioFlags & SCENARIO_BLOCK_HOSTAGE_RESCUE) && UTIL_FindEntityByClassname(nullptr, "hostage_entity"))
{
if (!OnRoundEnd_Intercept(WINSTATUS_TERRORISTS, ROUND_HOSTAGE_NOT_RESCUED, GetRoundRestartDelay()))
return;
}
else if (m_bMapHasEscapeZone)
else if (!(scenarioFlags & SCENARIO_BLOCK_PRISON_ESCAPE_TIME) && m_bMapHasEscapeZone)
{
if (!OnRoundEnd_Intercept(WINSTATUS_CTS, ROUND_TERRORISTS_NOT_ESCAPED, GetRoundRestartDelay()))
return;
}
else if (m_bMapHasVIPSafetyZone)
else if (!(scenarioFlags & SCENARIO_BLOCK_VIP_ESCAPE_TIME) && m_bMapHasVIPSafetyZone)
{
if (!OnRoundEnd_Intercept(WINSTATUS_TERRORISTS, ROUND_VIP_NOT_ESCAPED, GetRoundRestartDelay()))
return;
Expand Down

0 comments on commit 532c132

Please sign in to comment.