mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 10:42:59 +00:00
Harden minetest.after check
This commit is contained in:
parent
915ac2da93
commit
955638bccd
1 changed files with 4 additions and 4 deletions
|
@ -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.
|
-- play damage sound if health was reduced and make mob flash red.
|
||||||
if damaged then
|
if damaged then
|
||||||
self.object:set_texture_mod("^[colorize:#FF000040")
|
self.object:set_texture_mod("^[colorize:#FF000040")
|
||||||
minetest.after(.2, function()
|
minetest.after(.2, function(self)
|
||||||
if self then
|
if self and self.object then
|
||||||
self.object:set_texture_mod("")
|
self.object:set_texture_mod("")
|
||||||
end
|
end
|
||||||
end)
|
end, self)
|
||||||
mob_sound(self, self.sounds.damage)
|
mob_sound(self, self.sounds.damage)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue