From ed5c2c2019a3d86bfcac79e985ee3da4c0693627 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 25 Jan 2018 16:23:54 +0100 Subject: [PATCH] Tweak initial speed of TNT entitiy --- mods/ITEMS/mcl_tnt/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 6da3104d07..ce2bfef0aa 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -94,7 +94,10 @@ local TNT = { blinkstatus = true,} function TNT:on_activate(staticdata) - self.object:setvelocity({x=0, y=4, z=0}) + local phi = math.random(0, 65535) / 65535 * 2*math.pi + local hdir_x = math.cos(phi) * 0.02 + local hdir_z = math.sin(phi) * 0.02 + self.object:setvelocity({x=hdir_x, y=2, z=hdir_z}) self.object:setacceleration({x=0, y=-10, z=0}) self.object:settexturemod("^mcl_tnt_blink.png") end