Fix for texture mod issue - if mob gets hit while still indicating damage, it gets stuck with the damage effect.

This commit is contained in:
Jordan Leppert 2022-02-23 16:25:42 +00:00
parent f11e6d458f
commit 1efd508792
2 changed files with 14 additions and 16 deletions

View file

@ -203,13 +203,11 @@ local function index_box_border(self)
end end
function mob:indicate_damage() function mob:indicate_damage()
local texture_mod = self.object:get_texture_mod() self._original_texture_mod = self._original_texture_mod or self.object:get_texture_mod()
self.object:set_texture_mod("^[colorize:#FF000040") self.object:set_texture_mod(self._original_texture_mod .. "^[colorize:#FF000040")
self.object:set_texture_mod(texture_mod .. "^[colorize:#FF000040")
core.after(0.2, function() core.after(0.2, function()
if creatura.is_alive(self) then if creatura.is_alive(self) then
self.object:set_texture_mod("") self.object:set_texture_mod(self._original_texture_mod)
self.object:set_texture_mod(texture_mod)
end end
end) end)
end end