1
0

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
This commit is contained in:
Nate
2021-04-08 06:17:24 -04:00
committed by GitHub
parent 8efe55c62c
commit b2eddbed84
3 changed files with 38 additions and 3 deletions

View File

@@ -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;