From 961114c2607b4f7d5374df1fce327643d37acd90 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Mon, 28 May 2007 14:49:34 +0000 Subject: [PATCH] Fix for amb305 - tasks cause a crash on mods that do not have the standard mp_timelimit cvar. --- amxmodx/meta_api.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 9e47b515..0dbdb041 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -357,6 +357,22 @@ int C_Spawn(edict_t *pent) hostname = CVAR_GET_POINTER("hostname"); mp_timelimit = CVAR_GET_POINTER("mp_timelimit"); + // Fix for crashing on mods that do not have mp_timelimit + if (mp_timelimit == NULL) + { + static cvar_t timelimit_holder; + + timelimit_holder.name = "mp_timelimit"; + timelimit_holder.string = "0"; + timelimit_holder.flags = 0; + timelimit_holder.value = 0.0; + + CVAR_REGISTER(&timelimit_holder); + + mp_timelimit = &timelimit_holder; + + } + g_forwards.clear(); g_log.MapChange();