From b2eddbed84d55978337d1b52f6a9a2eabb658017 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 8 Apr 2021 06:17:24 -0400 Subject: Teleport off of mount when throwing enderpearl (#5179) * Teleport off of mount when throwing enderpearl * Simplify returning boolean * Oops forgot a semicolon * Fix code conventions in Player.h --- src/Entities/Player.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Entities/Player.cpp') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index a727429d4..d9c51fcef 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -2590,6 +2590,15 @@ void cPlayer::AttachTo(cEntity * a_AttachTo) void cPlayer::Detach() +{ + Detach(false); +} + + + + + +void cPlayer::Detach(bool a_IsTeleporting) { if (m_AttachedTo == nullptr) { @@ -2607,6 +2616,13 @@ void cPlayer::Detach() } Super::Detach(); + + // If they are teleporting, no need to figure out position + if (a_IsTeleporting) + { + return; + } + int PosX = POSX_TOINT; int PosY = POSY_TOINT; int PosZ = POSZ_TOINT; -- cgit v1.2.3