From 1b3d4c229eadb8d982365bde21106d204b7a3159 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 23 Jul 2010 13:52:25 +0200 Subject: Added a simple sanity check to avoid a gameserver crash at login. No review asked. --- src/scripting/script.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/scripting/script.cpp') diff --git a/src/scripting/script.cpp b/src/scripting/script.cpp index 359e94bd..8aa450b8 100644 --- a/src/scripting/script.cpp +++ b/src/scripting/script.cpp @@ -132,11 +132,17 @@ void Script::addDataToSpecial(int id, Special* special) first we have to agree on what other info we actually want to provide. */ - Script *script = Script::special_actions_script; - script->prepare("get_special_recharge_cost"); - script->push(id); - int scriptReturn = script->execute(); - special->neededMana = scriptReturn; + if (special) + { + Script *script = Script::special_actions_script; + if (script) + { + script->prepare("get_special_recharge_cost"); + script->push(id); + int scriptReturn = script->execute(); + special->neededMana = scriptReturn; + } + } } -- cgit v1.2.3-70-g09d2