fix destruction

This commit is contained in:
Alexsandro Percy 2023-06-17 19:53:39 -03:00
parent 495e3406ed
commit bb3307ca87

View File

@ -281,6 +281,10 @@ minetest.register_entity("trike:trike", {
logic = trike.flightstep,
on_punch = function(self, puncher, ttime, toolcaps, dir, damage)
if self.hp_max <= 0 then
trike.destroy(self)
end
if not puncher or not puncher:is_player() then
return
end