diff options
author | Blue <bluesansdouze@gmail.com> | 2009-05-03 23:32:40 +0200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-05-03 15:38:16 -0600 |
commit | a151d1693572f32fcd7572f20e80ed99500b42fa (patch) | |
tree | 40559bc84fe48798f09299b9c9861c9d8f554764 /src | |
parent | 44c0334a9046db41db0b8dc281727218fe89c3f2 (diff) | |
download | manaserv-a151d1693572f32fcd7572f20e80ed99500b42fa.tar.gz manaserv-a151d1693572f32fcd7572f20e80ed99500b42fa.tar.bz2 manaserv-a151d1693572f32fcd7572f20e80ed99500b42fa.tar.xz manaserv-a151d1693572f32fcd7572f20e80ed99500b42fa.zip |
Segfault correction lua
Corrects a segfault with lua scripts.
Diffstat (limited to 'src')
-rw-r--r-- | src/scripting/lua.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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()); |