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/Entity.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index d4097f734..593bc6aca 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1864,6 +1864,19 @@ bool cEntity::IsA(const char * a_ClassName) const +bool cEntity::IsAttachedTo(const cEntity * a_Entity) const +{ + if ((m_AttachedTo != nullptr) && (a_Entity->GetUniqueID() == m_AttachedTo->GetUniqueID())) + { + return true; + } + return false; +} + + + + + void cEntity::SetHeadYaw(double a_HeadYaw) { m_HeadYaw = a_HeadYaw; -- cgit v1.2.3