Throw error instead of crash when calling SetTeamScore between maps (bug 5718, r=psychonic).
authorKyle Sanderson <kyle.leet@gmail.com>
Thu Jul 18 11:38:04 2013 -0400 (2013-07-18)
changeset 3948530b0c5c8a33
parent 3947 999d29e113db
child 3949 3fefd8346c23
Throw error instead of crash when calling SetTeamScore between maps (bug 5718, r=psychonic).
extensions/sdktools/teamnatives.cpp
     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  	{