Fix #3955 (player dying on login).
authorNathanaƫl Courant <Ekdohibs@users.noreply.github.com>
Tue, 5 Apr 2016 23:11:36 +0000 (01:11 +0200)
committerest31 <est31@users.noreply.github.com>
Tue, 5 Apr 2016 23:11:36 +0000 (01:11 +0200)
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.

src/collision.cpp

index 16db3310c0d5b9640aa60c57b32abdf206382dd4..74c0c25c3e08d7ac7f7a7c6a4b583eaa5827658f 100644 (file)
@@ -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