From: Auke Kok Date: Wed, 30 Mar 2016 06:09:47 +0000 (-0700) Subject: Limit entity speed to 250m/s. X-Git-Tag: 0.4.14~35 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8114c3dbabfeb769d4f4f101df4974e8ffae75e2;p=oweals%2Fminetest_game.git Limit entity speed to 250m/s. Let's just call it "terminal" velocity. --- 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