mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-05 17:05:05 -05:00
Limit speed in collisionMoveResult for avoiding hangs
This commit is contained in:
parent
c1bf6f9f7a
commit
6b8435cf8c
@ -209,10 +209,15 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
|
||||
}
|
||||
speed_f += accel_f * dtime;
|
||||
|
||||
// If there is no speed, there are no collisions
|
||||
// If there is no speed, there are no collisions
|
||||
if(speed_f.getLength() == 0)
|
||||
return result;
|
||||
|
||||
// Limit speed for avoiding hangs
|
||||
speed_f.Y=rangelim(speed_f.Y,-5000,5000);
|
||||
speed_f.X=rangelim(speed_f.X,-5000,5000);
|
||||
speed_f.Z=rangelim(speed_f.Z,-5000,5000);
|
||||
|
||||
/*
|
||||
Collect node boxes in movement range
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user