diff options
author | Nathanaƫl Courant <Ekdohibs@users.noreply.github.com> | 2016-04-06 01:11:36 +0200 |
---|---|---|
committer | est31 <est31@users.noreply.github.com> | 2016-04-06 01:11:36 +0200 |
commit | 15e1dcc020ca5c64e4b5b306529e513cb2b97bef (patch) | |
tree | e37f2fbc1e52b76cc2fe0fa50d5fe8d1214cbb3a | |
parent | 24b32ab09d1967866ddc092cadc6f6d678dac0c6 (diff) | |
download | minetest-15e1dcc020ca5c64e4b5b306529e513cb2b97bef.tar.gz minetest-15e1dcc020ca5c64e4b5b306529e513cb2b97bef.tar.bz2 minetest-15e1dcc020ca5c64e4b5b306529e513cb2b97bef.zip |
Fix #3955 (player dying on login).
It was caused by player not moving because fall was prevented, but their
velocity still increasing, causing fatal fall damage when world was
finally loaded. This commit fixes it by setting player velocity to zero
when the world around them is not loaded.
-rw-r--r-- | src/collision.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/collision.cpp b/src/collision.cpp index 16db3310c..74c0c25c3 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -332,8 +332,10 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, // Do not move if world has not loaded yet, since custom node boxes // are not available for collision detection. - if (!any_position_valid) + if (!any_position_valid) { + *speed_f = v3f(0, 0, 0); return result; + } } // tt2 |