Skip to content

Objects with MF_PAIN can still hurt the player after they die

As is said in the title, after an object that has MF_PAIN as a flag dies, it can still hurt players that touch it. I don't think this is much of an issue in vanilla currently because all objects that have MF_PAIN either don't die or don't have a deathstate that keeps them around long.

Here's a quick lua script that changes all blue crawlas to die into the player standing state and making them have MF_PAIN, you can see that they all still hurt the player after they have died.

mobjinfo[MT_BLUECRAWLA].flags = MF_PAIN

mobjinfo[MT_BLUECRAWLA].deathstate = S_PLAY_STND

local function KillCrawlas(mobj)

	if mobj.health > 0 then

		P_KillMobj(mobj)

	end

	return true

end

addHook("MobjThinker", KillCrawlas, MT_BLUECRAWLA)