summaryrefslogtreecommitdiffstats
path: root/src/Entities/Pawn.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-02 18:40:03 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-02 18:40:03 +0100
commita8599efd778d601aa67703a558bc171f206f3763 (patch)
treeb6f5c8c073837c43f15b68414db1aaa92bbbab6a /src/Entities/Pawn.cpp
parentMerge pull request #2936 from mathias-github/master (diff)
parentFix cPawn pushing (diff)
downloadcuberite-a8599efd778d601aa67703a558bc171f206f3763.tar
cuberite-a8599efd778d601aa67703a558bc171f206f3763.tar.gz
cuberite-a8599efd778d601aa67703a558bc171f206f3763.tar.bz2
cuberite-a8599efd778d601aa67703a558bc171f206f3763.tar.lz
cuberite-a8599efd778d601aa67703a558bc171f206f3763.tar.xz
cuberite-a8599efd778d601aa67703a558bc171f206f3763.tar.zst
cuberite-a8599efd778d601aa67703a558bc171f206f3763.zip
Diffstat (limited to 'src/Entities/Pawn.cpp')
-rw-r--r--src/Entities/Pawn.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 6b404f7e0..2d86dfecf 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -73,6 +73,12 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return false;
}
+ // do not push a boat / minecart you're sitting in
+ if (m_Pusher->IsAttachedTo(a_Entity))
+ {
+ return false;
+ }
+
Vector3d v3Delta = a_Entity->GetPosition() - m_Pusher->GetPosition();
v3Delta.y = 0.0; // we only push sideways
v3Delta *= 1.0 / (v3Delta.Length() + 0.01); // we push harder if we're close