mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-30 06:43:45 +01:00
Harden minetest.after check
parent
915ac2da93
commit
955638bccd
@ -456,11 +456,11 @@ local check_for_death = function(self, cause, cmi_cause)
|
||||
-- play damage sound if health was reduced and make mob flash red.
|
||||
if damaged then
|
||||
self.object:set_texture_mod("^[colorize:#FF000040")
|
||||
minetest.after(.2, function()
|
||||
if self then
|
||||
minetest.after(.2, function(self)
|
||||
if self and self.object then
|
||||
self.object:set_texture_mod("")
|
||||
end
|
||||
end)
|
||||
end, self)
|
||||
mob_sound(self, self.sounds.damage)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user