]> git.lizzy.rs Git - Crafter.git/commitdiff
Fix repeated player death when in lava or fire
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 30 Jun 2020 05:27:20 +0000 (01:27 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 30 Jun 2020 05:27:20 +0000 (01:27 -0400)
mods/fire/init.lua

index 9b3f4569889c4905983d23f814b289a8acdc4cc9..6ce93d12fddd892b1ed73fbfa867518f0b56168e 100644 (file)
@@ -144,9 +144,11 @@ fire.timer = 0
 fire.life = 0
 fire.on_step = function(self,dtime)    
        if self.owner and (self.owner:is_player() or self.owner:get_luaentity()) then
+               if self.owner:is_player() and self.owner:get_hp() <= 0 then
+                       put_fire_out(self.owner)
+               end
                self.timer = self.timer + dtime
                self.life = self.life + dtime
-
                if self.life >= 7 then
                        put_fire_out(self.owner)
                        self.object:remove()