From 30c358658083fc4f4b16ea1aad990f6703c96393 Mon Sep 17 00:00:00 2001 From: Vaqtincha <37193273+Vaqtincha@users.noreply.github.com> Date: Tue, 30 Oct 2018 13:24:21 +0500 Subject: [PATCH] Enhance "endround" command (#319) --- regamedll/dlls/game.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index c9cff0e5..0f74a479 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -132,9 +132,23 @@ void GameDLL_Version_f() void GameDLL_EndRound_f() { - CSGameRules()->EndRoundMessage("#Round_Draw", ROUND_END_DRAW); - Broadcast("rounddraw"); - CSGameRules()->TerminateRound(5, WINSTATUS_DRAW); + if (CMD_ARGC() == 2) + { + const char *pCmd = CMD_ARGV(1); + + if (pCmd[0] == '1' || !Q_stricmp(pCmd, "T")) + { + CSGameRules()->OnRoundEnd_Intercept(WINSTATUS_TERRORISTS, ROUND_TERRORISTS_WIN, CSGameRules()->GetRoundRestartDelay()); + return; + } + else if (pCmd[0] == '2' || !Q_stricmp(pCmd, "CT")) + { + CSGameRules()->OnRoundEnd_Intercept(WINSTATUS_CTS, ROUND_CTS_WIN, CSGameRules()->GetRoundRestartDelay()); + return; + } + } + + CSGameRules()->OnRoundEnd_Intercept(WINSTATUS_DRAW, ROUND_END_DRAW, CSGameRules()->GetRoundRestartDelay()); } #endif // REGAMEDLL_ADD