Skip to content

Commit

Permalink
Core/GameObjects: Fixed DestroyGate battleground hook for vehicles (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Maphaze authored and Shauren committed Jul 11, 2018
1 parent 0004531 commit 2ef3315
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/game/Entities/GameObject/GameObject.cpp
Expand Up @@ -2192,9 +2192,9 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, WorldOb
EventInform(m_goInfo->building.destroyedEvent, attackerOrHealer);
AI()->Destroyed(attackerOrHealer, m_goInfo->building.destroyedEvent);

if (attackerOrHealer && attackerOrHealer->GetTypeId() == TYPEID_PLAYER)
if (Battleground* bg = attackerOrHealer->ToPlayer()->GetBattleground())
bg->DestroyGate(attackerOrHealer->ToPlayer(), this);
if (Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : nullptr)
if (Battleground* bg = player->GetBattleground())
bg->DestroyGate(player, this);

RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
Expand Down

2 comments on commit 2ef3315

@Shauren
Copy link
Member

@Shauren Shauren commented on 2ef3315 Jul 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just dont

@ccrs
Copy link
Member

@ccrs ccrs commented on 2ef3315 Jul 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always found it kinda redundant too... (inb4 someone links one of my commits with the word in it)

Please sign in to comment.