From 64327b8ddb8db2b2c27d52e09ce03ec0737ccf3a Mon Sep 17 00:00:00 2001 From: DynamicBits Date: Thu, 20 Mar 2014 19:05:41 +0100 Subject: [PATCH] Fix nextmap plugin failing in game where mp_chattime cvar doesn't exist (bug 5922, r=arkshine) --- plugins/nextmap.sma | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/nextmap.sma b/plugins/nextmap.sma index 0e3c845f..4af491fa 100755 --- a/plugins/nextmap.sma +++ b/plugins/nextmap.sma @@ -115,16 +115,20 @@ public sayFFStatus() public delayedChange(param[]) { - set_pcvar_float(g_mp_chattime, get_pcvar_float(g_mp_chattime) - 2.0) + if (g_mp_chattime) { + set_pcvar_float(g_mp_chattime, get_pcvar_float(g_mp_chattime) - 2.0) + } server_cmd("changelevel %s", param) } public changeMap() { new string[32] - new Float:chattime = get_pcvar_float(g_mp_chattime) + new Float:chattime = g_mp_chattime ? get_pcvar_float(g_mp_chattime) : 10.0; // mp_chattime defaults to 10 in other mods - set_pcvar_float(g_mp_chattime, chattime + 2.0) // make sure mp_chattime is long + if (g_mp_chattime) { + set_pcvar_float(g_mp_chattime, chattime + 2.0) // make sure mp_chattime is long + } new len = getNextMapName(string, charsmax(string)) + 1 set_task(chattime, "delayedChange", 0, string, len) // change with 1.5 sec. delay }