Skip to content

Commit

Permalink
Fix Possess action bars regression
Browse files Browse the repository at this point in the history
Also expand the comment a bit on why we grant control in this context
  • Loading branch information
Warlockbugs committed Jun 5, 2023
1 parent 5c64aab commit 8a1666a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11112,7 +11112,7 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, uint32 effIdx, float x,
player->UnsummonPetTemporaryIfAny();

player->GetCamera().SetView(possessed); // modify camera view to the creature view
// Force client control (required to function propely)
// Force granting client control (required for action bars to function propely, will be taken away on demand after action bars update below)
player->UpdateClientControl(possessed, true, true); // transfer client control to the creature after altering flags
player->SetMover(possessed); // set mover so now we know that creature is "moved" by this unit
player->SendForcedObjectUpdate(); // we have to update client data here to avoid problem with the "release spirit" windows reappear.
Expand Down Expand Up @@ -11253,8 +11253,8 @@ bool Unit::TakePossessOf(Unit* possessed)
if (player)
{
player->GetCamera().SetView(possessed);
// Force client control (required to function propely)
player->UpdateClientControl(possessed, !IsCrowdControlled(), true);
// Force granting client control (required for action bars to function propely, will be taken away on demand after action bars update below)
player->UpdateClientControl(possessed, true, true);
player->SetMover(possessed);
player->SendForcedObjectUpdate();

Expand Down

0 comments on commit 8a1666a

Please sign in to comment.