mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-21 21:20:04 +00:00
Fix bad null check and dynamic ID calculation
This commit is contained in:
parent
aa3dacc84b
commit
d5fc36f877
@ -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[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user