Throw error instead of crash when calling SetTeamScore between maps (bug 5718, r=psychonic).
This commit is contained in:
parent
69d8b1c30d
commit
1f88f1f3f6
@ -164,6 +164,11 @@ static cell_t GetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
static cell_t SetTeamScore(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
if (!g_pSM->IsMapRunning())
|
||||
{
|
||||
return pContext->ThrowNativeError("Cannot set team score when no map is running");
|
||||
}
|
||||
|
||||
int teamindex = params[1];
|
||||
if (teamindex >= (int)g_Teams.size() || !g_Teams[teamindex].ClassName)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user