azerothcore / azerothcore-wotlk

Complete Open Source and Modular solution for MMO
http://www.azerothcore.org
GNU Affero General Public License v3.0
6.59k stars 2.64k forks source link

Warrior's stance removed from several events #20024

Closed alecsci closed 2 weeks ago

alecsci commented 1 month ago

Current Behaviour

Reported by: https://github.com/chromiecraft/chromiecraft/issues/6149 It happens for (it doesn't matter if it's win or loss):

Expected Blizzlike Behaviour

When you finish an arena match as a warrior you will be taken out of your stance.

Source

Assumption. Since it was reported several times for BG, I assume everyone assumes the stances should be maintained.

Steps to reproduce the problem

Join an arena team as a warrior. Queue for and join an arena match, Complete the arena match. Observe you are not stanced.

Do the same for BG

Extra Notes

https://github.com/azerothcore/azerothcore-wotlk/issues/7402

AC rev. hash/commit

014602c849a3310bdae6feda8f6fd695878f1eb5

Operating system

Windows 11 x64

Custom changes or Modules

None

sogladev commented 1 month ago

I was able to reproduce this when leaving arena and bg. I cannot reproduce this with leaving/finishing RDF after q'ing as 5man

I found the problematic statement: https://github.com/azerothcore/azerothcore-wotlk/blob/510422a4f5ecca4afdcc41bedac2b5f4bae1706d/src/server/game/Battlegrounds/Battleground.cpp#L1053

shapeshift auras are removed in the following functions: Battleground::EndBattleground() https://github.com/azerothcore/azerothcore-wotlk/blob/510422a4f5ecca4afdcc41bedac2b5f4bae1706d/src/server/game/Battlegrounds/Battleground.cpp#L846

Battleground::RemovePlayerAtLeave() https://github.com/azerothcore/azerothcore-wotlk/blob/510422a4f5ecca4afdcc41bedac2b5f4bae1706d/src/server/game/Battlegrounds/Battleground.cpp#L970

The first intends to only removes spirit of redemption, the second was changed during sunwellcore[1] to include all shape shift auras which includes spirit of redemption, druid forms, warrior stances, shadowform,...

I can't tell why this was changed to remove all SPELL_AURA_MOD_SHAPESHIFT, but it is incorrect.

I don't see any problematic auras with Aura Id 36 (SPELL_AURA_MOD_SHAPESHIFT) besides spirit of redemption that need to be removed. Reverting it makes sense to me

diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index b9858b3506..1e951e4b08 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1008,2 +1008,6 @@ void Battleground::RemovePlayerAtLeave(Player* player)

+    // should remove spirit of redemption
+    if (player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
+        player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
+
     // if the player was a match participant
@@ -1051,5 +1055,2 @@ void Battleground::RemovePlayerAtLeave(Player* player)

-    // Remove shapeshift auras
-    player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
-
     player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, PLAYER_MAX_BATTLEGROUND_QUEUES, false, false, TEAM_NEUTRAL);

[1]TC blame 2009 https://github.com/TrinityCore/TrinityCore/blame/2e127f7a30706dc1d40c65de22ff02851732da24/src/game/BattleGround.cpp#L1024C23-L1024C23 acore goes back to initial commit

offtopic maybe, but when leaving RDF as dead (.die then right click leave group on portrait) should you not be revived before tp'ing?

avarishd commented 2 weeks ago

was this fixed by https://github.com/azerothcore/azerothcore-wotlk/pull/20069?

heyitsbench commented 2 weeks ago

Yes.