Throw error instead of crash when calling SetTeamScore between maps (bug 5718, r=psychonic).
Throw error instead of crash when calling SetTeamScore between maps (
bug 5718, r=psychonic).
1.1 --- a/extensions/sdktools/teamnatives.cpp Thu Jul 18 10:27:12 2013 -0400
1.2 +++ b/extensions/sdktools/teamnatives.cpp Thu Jul 18 11:38:04 2013 -0400
1.3 @@ -164,6 +164,11 @@
1.4
1.5 static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
1.6 {
1.7 + if (!g_pSM->IsMapRunning())
1.8 + {
1.9 + return pContext->ThrowNativeError("Cannot set team score when no map is running");
1.10 + }
1.11 +
1.12 int teamindex = params[1];
1.13 if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
1.14 {