// Midiman's Quick hack that prevents the lava from eating rings

local function NoRingEatingLava(target, inflictor, source, damagetype)
	if not mapheaderinfo[gamemap].lavacanteat then return end --  if the map doesn't have parameter lavacanteat, abort the function
	if not (target and target.valid) then return end
	
	if damagetype and damagetype == DMG_FIRE
		target.flags = target.info.flags
		target.health = target.info.spawnhealth
		return true
	end
end

addHook("PlayerThink", NoRingEatingLava)
addHook("MobjDeath", NoRingEatingLava, MT_RING)
addHook("MobjDeath", NoRingEatingLava, MT_FLINGRING)
