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

local function NoCoinEatingLava(target, inflictor, source, damagetype)
	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("MobjDeath", NoCoinEatingLava, MT_COIN)
addHook("MobjDeath", NoCoinEatingLava, MT_FLINGCOIN)
