From 4b2b02a8ba1cf259ead477cc256c4ac2a994809c Mon Sep 17 00:00:00 2001 From: CoolPuppyKid <68360803+CoolPuppyKid@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:22:37 -0600 Subject: [PATCH] Fixed Weird Tp Fail Damage (#5591) * Fixed Weird Tp Fail Damage * i added a ; by mistake * Update CONTRIBUTORS * fixed my name --- CONTRIBUTORS | 1 + src/Entities/Pawn.cpp | 2 +- src/Entities/Player.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 4c4e59fe4..5ecfa81da 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -19,6 +19,7 @@ birkett (Anthony Birkett) Bond_009 changyongGuo Cocosushi6 +CoolPuppyKid DarkoGNU derouinw dImrich (Damian Imrich) diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp index 61653acd2..6ff28386a 100644 --- a/src/Entities/Pawn.cpp +++ b/src/Entities/Pawn.cpp @@ -402,7 +402,7 @@ void cPawn::HandleFalling(void) auto Player = static_cast(this); /* 3. If the player is flying or climbing, absorb fall damage */ - FallDamageAbsorbed |= Player->IsFlying() || Player->IsClimbing(); + FallDamageAbsorbed |= Player->IsFlying() || Player->IsClimbing() || Player->GetIsTeleporting(); /* 4. If the player is about to bounce on a slime block and is not crouching, absorb all fall damage */ ShouldBounceOnSlime = !Player->IsCrouched(); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index cee8a1a9c..38055504d 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -147,6 +147,9 @@ public: /** Cancels the current bow charging */ void CancelChargingBow(void); + /** Gets If The Player Is Teleporting To Fix https://github.com/cuberite/cuberite/issues/5542 */ + bool GetIsTeleporting() { return m_IsTeleporting; } + /** Returns true if the player is currently charging the bow */ bool IsChargingBow(void) const { return m_IsChargingBow; }