Battleground/Strand of the Ancients: Fix broken gate state

This commit is contained in:
Vincent-Michael
2012-04-22 13:36:18 +02:00
parent bc4303d8f9
commit ddd25ce716
2 changed files with 73 additions and 26 deletions
@@ -534,16 +534,16 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui
if (eventType == go->GetGOInfo()->building.damagedEvent)
{
uint32 i = GetGateIDFromDestroyEventID(eventType);
uint32 i = getGateIdFromDamagedOrDestroyEventId(eventType);
GateStatus[i] = BG_SA_GATE_DAMAGED;
uint32 uws = GetWorldStateFromGateID(i);
uint32 uws = getWorldStateFromGateId(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
}
if (eventType == go->GetGOInfo()->building.destroyedEvent)
{
if (go->GetGOInfo()->building.destroyedEvent == 19837)
if (go->GetGOInfo()->building.destroyedEvent == BG_SA_EVENT_ANCIENT_GATE_DESTROYED)
SendWarningToAll(LANG_BG_SA_CHAMBER_BREACHED);
else
SendWarningToAll(LANG_BG_SA_WAS_DESTROYED, go->GetGOInfo()->name.c_str());
@@ -603,7 +603,7 @@ void BattlegroundSA::DemolisherStartState(bool start)
void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
{
uint32 i = GetGateIDFromDestroyEventID(go->GetGOInfo()->building.destroyedEvent);
uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent);
if (!GateStatus[i])
return;
@@ -612,7 +612,7 @@ void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
if (g->GetGOValue()->Building.Health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws = GetWorldStateFromGateID(i);
uint32 uws = getWorldStateFromGateId(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
bool rewardHonor = true;