From a1c48f4853b234e920e96671c4ff218567d4f2d4 Mon Sep 17 00:00:00 2001 From: Marvin Kopf Date: Tue, 2 Feb 2016 14:44:10 +0100 Subject: Fix cPawn pushing cPawn instances can no longer push an entity they are attached to. cEntity now has a IsAttachedTo method. --- src/Entities/Pawn.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Entities/Pawn.cpp') 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 -- cgit v1.2.3