diff --git a/extensions/cstrike/forwards.cpp b/extensions/cstrike/forwards.cpp index 48213f02..c7fae457 100644 --- a/extensions/cstrike/forwards.cpp +++ b/extensions/cstrike/forwards.cpp @@ -122,6 +122,10 @@ DETOUR_DECL_MEMBER1(DetourTerminateRound, void, int, reason) cell_t result = Pl_Continue; + #if SOURCE_ENGINE == SE_CSGO + reason--; + #endif + g_pTerminateRoundForward->PushFloatByRef(&delay); g_pTerminateRoundForward->PushCellByRef(&reason); g_pTerminateRoundForward->Execute(&result); @@ -129,6 +133,10 @@ DETOUR_DECL_MEMBER1(DetourTerminateRound, void, int, reason) if (result >= Pl_Handled) return; + #if SOURCE_ENGINE == SE_CSGO + reason++; + #endif + #if SOURCE_ENGINE != SE_CSGO || !defined(WIN32) if (result == Pl_Changed) return DETOUR_MEMBER_CALL(DetourTerminateRound)(delay, reason); diff --git a/extensions/cstrike/natives.cpp b/extensions/cstrike/natives.cpp index 1b4ebcf5..75773f07 100644 --- a/extensions/cstrike/natives.cpp +++ b/extensions/cstrike/natives.cpp @@ -330,6 +330,12 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params) return pContext->ThrowNativeError("GameRules not available. TerminateRound native disabled."); } + int reason = params[2]; + +#if SOURCE_ENGINE == SE_CSGO + reason++; +#endif + #if SOURCE_ENGINE != SE_CSGO || !defined(WIN32) static ICallWrapper *pWrapper = NULL; @@ -356,7 +362,7 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params) vptr += sizeof(void *); *(float *)vptr = sp_ctof(params[1]); vptr += sizeof(float); - *(int*)vptr = params[2]; + *(int*)vptr = reason; pWrapper->Execute(vstk, NULL); #else @@ -371,7 +377,7 @@ static cell_t CS_TerminateRound(IPluginContext *pContext, const cell_t *params) g_pIgnoreTerminateDetour = true; float delay = sp_ctof(params[1]); - int reason = params[2]; + __asm { push reason diff --git a/plugins/include/cstrike.inc b/plugins/include/cstrike.inc index ea497b63..9cbedcb7 100644 --- a/plugins/include/cstrike.inc +++ b/plugins/include/cstrike.inc @@ -70,6 +70,8 @@ enum CSRoundEndReason // The below only exist on CS:GO CSRoundEnd_TerroristsSurrender, /**< Terrorists Surrender */ CSRoundEnd_CTSurrender, /**< CTs Surrender */ + CSRoundEnd_TerroristsPlaned, /**< Terrorists Planted the bomb */ + CSRoundEnd_CTsReachedHostage, /**< CTs Reached the hostage */ }; enum CSWeaponID