projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6cef57
)
Limit entity speed to 250m/s.
author
Auke Kok
<sofar@foo-projects.org>
Wed, 30 Mar 2016 06:09:47 +0000
(23:09 -0700)
committer
paramat
<mat.gregory@virginmedia.com>
Sat, 16 Apr 2016 18:27:16 +0000
(19:27 +0100)
Let's just call it "terminal" velocity.
mods/tnt/init.lua
patch
|
blob
|
history
diff --git
a/mods/tnt/init.lua
b/mods/tnt/init.lua
index bb1f144b68c075fe9de1bc6e59eebffba27f8c37..f465620142a6c70903e12617d19079f42765d8cb 100644
(file)
--- 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