summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-11-10 18:33:04 +0100
committerworktycho <work.tycho@gmail.com>2015-11-10 18:33:04 +0100
commitef1b82a33d52ac176d85ed2595af7b81c63a82a4 (patch)
tree64adf6046d78c0be7a4e5f04853303de37201359 /src
parentMerge pull request #2633 from cuberite/IncludeBrewingRecipes (diff)
parentAvoid division by zero (diff)
downloadcuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar.gz
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar.bz2
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar.lz
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar.xz
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.tar.zst
cuberite-ef1b82a33d52ac176d85ed2595af7b81c63a82a4.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Pawn.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 5ca0c6126..ca2d413df 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -70,7 +70,7 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
Vector3d v3Delta = a_Entity->GetPosition() - m_Pusher->GetPosition();
v3Delta.y = 0.0; // we only push sideways
- v3Delta *= 1.0 / v3Delta.Length(); // we push harder if we're close
+ v3Delta *= 1.0 / (v3Delta.Length() + 0.01); // we push harder if we're close
// QUESTION: is there an additional multiplier for this? current shoving seems a bit weak
a_Entity->AddSpeed(v3Delta);