A few miscellaneous fixes
-
FF_BRIGHTMASK,FF_OVERLAYandMSF_INVERTPRECIPwere not exposed to Lua. - Delete an unused, obscure SOC feature called
ResetDatathat apparently didn't even work (yes it exists). - Fix a longstanding bug causing mobj hooks to be called with an invalid mobj argument if multiple hooks of the same kind had been registered for that mobj, and one of the hooks removed the mobj.
For the third one, here is a MRE:
freeslot("MT_TEST", "S_TEST")
mobjinfo[MT_TEST] = {
spawnstate = S_TEST,
spawnhealth = 1,
radius = 16*FU,
height = 16*FU,
flags = 0
}
states[S_TEST] = { SPR_POSS, 0 }
addHook("MobjThinker", function(mobj)
print("[MobjThinker1] mobj.valid = " .. tostring(mobj.valid))
P_RemoveMobj(mobj)
end, MT_TEST)
addHook("MobjThinker", function(mobj)
print("[MobjThinker2] mobj.valid = " .. tostring(mobj.valid))
end, MT_TEST)
COM_AddCommand("t", function()
P_SpawnMobj(0, 0, 0, MT_TEST)
end)
Edited by LJ Sonic