Make activated tnt minecarts glow in the dark, fix crash with lit tnt minecarts

This commit is contained in:
teknomunk 2024-08-10 20:56:34 -05:00
parent 3602f198d8
commit 3306814437
1 changed files with 16 additions and 10 deletions

View File

@ -18,15 +18,18 @@ local function activate_tnt_minecart(self, timer)
else else
self._boomtimer = tnt.BOOMTIMER self._boomtimer = tnt.BOOMTIMER
end end
self.object:set_properties({textures = { self.object:set_properties({
"mcl_tnt_blink.png", textures = {
"mcl_tnt_blink.png", "mcl_tnt_blink.png",
"mcl_tnt_blink.png", "mcl_tnt_blink.png",
"mcl_tnt_blink.png", "mcl_tnt_blink.png",
"mcl_tnt_blink.png", "mcl_tnt_blink.png",
"mcl_tnt_blink.png", "mcl_tnt_blink.png",
"mcl_minecarts_minecart.png", "mcl_tnt_blink.png",
}}) "mcl_minecarts_minecart.png",
},
glow = 15,
})
self._blinktimer = tnt.BLINKTIMER self._blinktimer = tnt.BLINKTIMER
minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true) minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true)
end end
@ -95,7 +98,10 @@ mod.register_minecart({
detonate_tnt_minecart(self) detonate_tnt_minecart(self)
return return
else else
tnt.smoke_step(pos) local pos = mod.get_cart_position(self._staticdata) or self.object:get_pos()
if pos then
tnt.smoke_step(pos)
end
end end
end end