From a151d1693572f32fcd7572f20e80ed99500b42fa Mon Sep 17 00:00:00 2001 From: Blue Date: Sun, 3 May 2009 23:32:40 +0200 Subject: Segfault correction lua Corrects a segfault with lua scripts. --- src/scripting/lua.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 4cd2c52f..4ea86985 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -196,6 +196,11 @@ static int npc_end(lua_State *s) NPC *p = getNPC(s, 1); Character *q = getCharacter(s, 2); + if (!p || !q) + { + raiseScriptError(s, "npc_end called with incorrect parameters."); + return 0; + } MessageOut msg(GPMSG_NPC_CLOSE); msg.writeShort(p->getPublicID()); -- cgit v1.2.3-70-g09d2