freeslot("MT_BM_GHOST")

addHook("MobjThinker", function(mo)
	if mo
	and mo.valid
	and mo.health
	and mo.type == MT_BM_GHOST
		mo.shadowscale = 0
	end
	if mo.state == S_BM_GHOST_FLOAT
		if mo.flags == MF_NOCLIPTHING
			mo.flags = $1 & ~MF_NOCLIPTHING
			mo.flags = $1 & MF_ENEMY
		end
	end
	if mo.state == S_BM_GHOST_PAIN
		if mo.flags == MF_ENEMY
			mo.flags = $1 & ~MF_ENEMY
		end
	end
end, MT_BM_GHOST)