TrinityCore icon indicating copy to clipboard operation
TrinityCore copied to clipboard

Core/Movement: Flying npcs remains in the air once dead

Open ghost opened this issue 14 years ago • 24 comments

When a player dies while he's in the air, the body remains in the air instead of falling down to the ground.

This bug makes resurrection spells harder and sometimes impossible to cast. Same with self resurrection.


Core rev. hash: f2e92b81a30da8150d99644c4f112bd712dbf28e TDB: 335.49+ OS: Unix 64bit


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ghost avatar Oct 28 '12 18:10 ghost

Confirmed. You have to meet spirit healer and get sickness.

digz6666 avatar Oct 30 '12 01:10 digz6666

It also affects creatures, really, really ancient bug. 1aada1f5ef14

Aokromes avatar Feb 14 '14 18:02 Aokromes

instead of faliing down to the ground.

is the body supposed to appear in air and then fall down or it should be spawned on the ground already ?

jackpoz avatar Mar 01 '14 17:03 jackpoz

all auras are already removed on death, player is never flying in this case

diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5217,7 +5217,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)

 void Player::KillPlayer()
 {
-    if (IsFlying() && !GetTransport())
+    if (!GetTransport())
         GetMotionMaster()->MoveFall();

     SetMovement(MOVE_ROOT);

joschiwald avatar Mar 02 '14 00:03 joschiwald

I am not sure about players, maybe someone can try this on retail...

But flying creatures have to fall to ground on death. http://www.youtube.com/watch?feature=player_detailpage&v=T1APOSl6Seo#t=170

Pitcrawler avatar Mar 02 '14 08:03 Pitcrawler

@joschiwald any update on the issue and on your patch ?

jackpoz avatar Oct 05 '14 13:10 jackpoz

Cannot reproduce on rev. 68c4ea314443, every time I die in the air the corpse fall down.

Killyana avatar Feb 26 '15 20:02 Killyana

jackpoz commented on 1 Mar 2014 :

is the body supposed to appear in air and then fall down or it should be spawned on the ground already ?

The body is supposed to fall to the ground. I just tested this on rev. 562da2e8b2b0 2015-05-31 01:01:55 +0200 (3.3.5 branch) (Win64, Release), used a level 64 horde DK character and a level 64 alliance hunter character on the ground, firing at the DK. When the DK died, he lost the flying mount aura and fell down. Then again, when testing a duel between 2 characters, either 2x horde or horde + alliance, the character mounted on the flying mount stayed in the air when defeated, while the duel flag floated up to the defeated character.

While this test seems inconclusive, I flew to Skettis in Terokkar Forest to look for flying enemies. Using the command .die on the Monstrous Kaliri birds, they fall down when killed. Also testing the character on a flying mount, I let my character get killed by those NPCs and the dead character fell to the ground (repeatedly).

If there are other ways to test this issue, please explain what to test to replicate the issue properly.

Edit: I tested killing Kael'thas Sunstrider in his flying/floating phase in The Eye, he stayed up there. Then again, I suppose that it is highly unlikely that a raid would be able to take him down in that phase.

ghost avatar May 31 '15 07:05 ghost

tkrokli, jackpoz asked if the body is supposed to do one or the other thing on live severs, actually, what it did in 3.3.5a live, not what happens in TC. :)

Someone should also test following scenario. Fly high, really high, or get to some high grounds, and dismount or jump down. I remember that many times your corpse would not spawn on the spot you died on the ground, rather in the air, sometimes making it impossible to resurrect. I can't do test myself atm.

emptyus avatar May 31 '15 10:05 emptyus

Well, if he wanted to ask what happens on live servers, he could have said so. Is my testing invalid? I conferred with Aokromes on this, though he told me that this is very, very difficult to test, because you need to be 3 players on a very low latency connection to verify this in a satisfactory manner. If it is not enough to verify this against @Dexie's original post, then this issue will stay open for years to come.

ghost avatar May 31 '15 11:05 ghost

As for creature bodies, it's really easy to test it on the eye's kaelthas on fly phase.

Reproduced on 35f2f5530abc.

http://i.imgur.com/fCEtexl.jpg

Aokromes avatar May 31 '15 12:05 Aokromes

Not tested and not sure if this is correct:


diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index ef92797..eba8180 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1536,8 +1536,7 @@ void Creature::setDeathState(DeathState s)
         if (m_formation && m_formation->getLeader() == this)
             m_formation->FormationReset(true);

-        if ((CanFly() || IsFlying()))
-            GetMotionMaster()->MoveFall();
+        GetMotionMaster()->MoveFall();

         Unit::setDeathState(CORPSE);
     }

Goatform avatar Sep 12 '16 15:09 Goatform

any news?

Keader avatar Oct 25 '16 14:10 Keader

Not all creatures should fall on death (see Kologarn for example)

ariel- avatar Oct 25 '16 17:10 ariel-

Anything here is valid? if yes, plz open a pr for it.

Aokromes avatar Mar 26 '17 00:03 Aokromes

The remaining issue is flying npc remains in the air once dead if they have "CanFly" instead of "DisableGravity".

Killyana avatar Mar 05 '19 15:03 Killyana

yeah i got one report yesterday of onixia's body being on air because it was killed to fast.

Aokromes avatar Mar 05 '19 15:03 Aokromes

fixed like this: this is weird as bool needsFalling must be true for creature with "CanFly" movement, it works correctly for npcs with "DisableGravity"

diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index c3a46e44a2..d5450c6a47 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1934,9 +1934,7 @@ void Creature::setDeathState(DeathState s)
 
         bool needsFalling = IsFlying() || IsHovering();
         SetHover(false);
-
-        if (needsFalling)
-            GetMotionMaster()->MoveFall();
+        GetMotionMaster()->MoveFall();
 
         Unit::setDeathState(CORPSE);
     }

Killyana avatar Mar 05 '19 16:03 Killyana

Reason for that is simple https://github.com/TrinityCore/TrinityCore/blob/70cefbe86616aa6411a85e1622c82c12a1ca67fa/src/server/game/Entities/Unit/Unit.h#L1636 It checks FLYING instead of CAN_FLY flag

Its kind of a weird situation but FLYING flag is set only for players that are in air and have CAN_FLY flag while creatures also use CAN_FLY but never get FLYING one (and this is blizzlike)

Shauren avatar Mar 07 '19 10:03 Shauren

In this case we need to add CanFly() to needsFalling or just replace IsFlying() ?

Killyana avatar Mar 07 '19 12:03 Killyana