From 8114c3dbabfeb769d4f4f101df4974e8ffae75e2 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Tue, 29 Mar 2016 23:09:47 -0700 Subject: [PATCH] Limit entity speed to 250m/s. Let's just call it "terminal" velocity. --- mods/tnt/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index bb1f144b..f4656201 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -120,6 +120,12 @@ local function calc_velocity(pos1, pos2, old_vel, power) -- Add old velocity vel = vector.add(vel, old_vel) + + -- Limit to terminal velocity + dist = vector.length(vel) + if dist > 250 then + vel = vector.divide(vel, dist / 250) + end return vel end