Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/game/shared/hl2mp/hl2mp_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,11 @@ void CHL2MPRules::CheckRestartGame( void )

if ( iRestartDelay > 0 )
{
#ifdef NEO
if (iRestartDelay != MAGIC_NEO_RESTART_THIS)
{
#endif

if ( iRestartDelay > 60 )
iRestartDelay = 60;

Expand All @@ -1251,6 +1256,11 @@ void CHL2MPRules::CheckRestartGame( void )
UTIL_ClientPrintAll( HUD_PRINTCENTER, "Game will restart in %s1 %s2", strRestartDelay, iRestartDelay == 1 ? "SECOND" : "SECONDS" );
UTIL_ClientPrintAll( HUD_PRINTCONSOLE, "Game will restart in %s1 %s2", strRestartDelay, iRestartDelay == 1 ? "SECOND" : "SECONDS" );

#ifdef NEO
}
else iRestartDelay = 0;
#endif

m_flRestartGameTime = gpGlobals->curtime + iRestartDelay;
m_bCompleteReset = true;
mp_restartgame.SetValue( 0 );
Expand Down
2 changes: 1 addition & 1 deletion src/game/shared/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ConVar neo_restart_this("neo_restart_this", "0", FCVAR_GAMEDLL, "If non-zero, ga
[](IConVar* var, const char* pOldValue, float flOldValue)->void {
if (ConVarRef(var).GetBool())
{
if (NEORules()) NEORules()->RestartGame();
mp_restartgame.SetValue(MAGIC_NEO_RESTART_THIS);
}
var->SetValue("0");
});
Expand Down
5 changes: 5 additions & 0 deletions src/game/shared/neo/neo_gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
#define CNEOGameRulesProxy C_NEOGameRulesProxy
#endif

// NEO JANK (Rain): magic value for signaling a mp_restart originated from "neo_restart_this".
// This is a hack around neo_restart_this leaking edicts for some reason; for now, it just
// repurposes the mp_restartgame logic but without the HL2DM-style center print.
constexpr float MAGIC_NEO_RESTART_THIS = 0xdaff;

class CNEOGameRulesProxy : public CHL2MPGameRulesProxy
{
public:
Expand Down