From 33068144378d587404c1ea37d9f340be093de67d Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 10 Aug 2024 20:56:34 -0500 Subject: [PATCH] Make activated tnt minecarts glow in the dark, fix crash with lit tnt minecarts --- .../ENTITIES/mcl_minecarts/carts/with_tnt.lua | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/carts/with_tnt.lua b/mods/ENTITIES/mcl_minecarts/carts/with_tnt.lua index 82bc1718e..8b0c7d869 100644 --- a/mods/ENTITIES/mcl_minecarts/carts/with_tnt.lua +++ b/mods/ENTITIES/mcl_minecarts/carts/with_tnt.lua @@ -18,15 +18,18 @@ local function activate_tnt_minecart(self, timer) else self._boomtimer = tnt.BOOMTIMER end - self.object:set_properties({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_minecarts_minecart.png", - }}) + self.object:set_properties({ + 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_minecarts_minecart.png", + }, + glow = 15, + }) self._blinktimer = tnt.BLINKTIMER minetest.sound_play("tnt_ignite", {pos = self.object:get_pos(), gain = 1.0, max_hear_distance = 15}, true) end @@ -95,7 +98,10 @@ mod.register_minecart({ detonate_tnt_minecart(self) return 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