diff options
author | Nate <nate@natedpalm.com> | 2021-04-08 12:17:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 12:17:24 +0200 |
commit | b2eddbed84d55978337d1b52f6a9a2eabb658017 (patch) | |
tree | a5d82669cf41867c5eec12542ed71f74c4056374 /src/Entities/Player.cpp | |
parent | Change to Cuboid calculation for splash distance (#5176) (diff) | |
download | cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar.gz cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar.bz2 cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar.lz cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar.xz cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.tar.zst cuberite-b2eddbed84d55978337d1b52f6a9a2eabb658017.zip |
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r-- | src/Entities/Player.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ -2591,6 +2591,15 @@ void cPlayer::AttachTo(cEntity * a_AttachTo) void cPlayer::Detach() { + Detach(false); +} + + + + + +void cPlayer::Detach(bool a_IsTeleporting) +{ if (m_AttachedTo == nullptr) { // The player is not attached to anything. Bail out. @@ -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; |