Fix bad null check and dynamic ID calculation

This commit is contained in:
gsemaj 2021-05-09 09:36:50 -04:00
parent aa3dacc84b
commit d5fc36f877

View File

@ -62,11 +62,11 @@ static int npc_getSpeed(lua_State *state) {
CombatNPC *npc = grabNPC(state, 1); CombatNPC *npc = grabNPC(state, 1);
// sanity check // sanity check
if (npc != NULL) if (npc == NULL)
return 0; return 0;
lua_pushinteger(state, npc->speed); lua_pushinteger(state, npc->speed);
return 0; return 1;
} }
static const luaL_Reg npc_getters[] = { static const luaL_Reg npc_getters[] = {