diff --git a/src/lua/NPCWrapper.cpp b/src/lua/NPCWrapper.cpp index 0208597..8110119 100644 --- a/src/lua/NPCWrapper.cpp +++ b/src/lua/NPCWrapper.cpp @@ -62,11 +62,11 @@ static int npc_getSpeed(lua_State *state) { CombatNPC *npc = grabNPC(state, 1); // sanity check - if (npc != NULL) + if (npc == NULL) return 0; lua_pushinteger(state, npc->speed); - return 0; + return 1; } static const luaL_Reg npc_getters[] = { @@ -263,4 +263,4 @@ void LuaManager::NPC::init(lua_State *state) { void LuaManager::NPC::push(lua_State *state, CombatNPC *npc) { Entity::push(state, EntityRef(npc->appearanceData.iNPC_ID), LIBNAME); -} \ No newline at end of file +}