Extend: Load anyway, despite no game config.

Disable the GameOver cancel instead.
This commit is contained in:
zaCade 2018-08-05 15:56:35 +02:00
parent 326c340b27
commit 6f7ae68436

View File

@ -14,6 +14,7 @@ ConVar g_cvarMpFragLimit = null;
ConVar g_cvarMpWinLimit = null;
ConVar g_cvarMpTimeLimit = null;
bool g_bGameOver = false;
Address g_pGameOver;
public Plugin myinfo =
@ -71,16 +72,20 @@ public void OnPluginStart()
Handle hGameConf = LoadGameConfigFile("Extend.games");
if(hGameConf == INVALID_HANDLE)
{
SetFailState("Couldn't load Extend.games game config!");
g_bGameOver = false;
LogError("Couldn't load Extend.games game config! GameOver cancel disabled.");
return;
}
if(!(g_pGameOver = GameConfGetAddress(hGameConf, "GameOver")))
{
g_bGameOver = false;
CloseHandle(hGameConf);
SetFailState("Couldn't get GameOver address from game config!");
LogError("Couldn't get GameOver address from game config! GameOver cancel disabled.");
return;
}
g_bGameOver = true;
CloseHandle(hGameConf);
}
@ -364,6 +369,9 @@ public int Handler_VoteCallback(Menu menu, MenuAction action, int param1, int pa
void CancelGameOver()
{
if (!g_bGameOver)
return;
StoreToAddress(g_pGameOver, 0, NumberType_Int8);
for (int client = 1; client <= MaxClients; client++)