mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Wintergrasp Fix Collision Wall work: Open / Close collision wall when battle started/ended (#22342)
* Open / Close collision wall when battle started/ended
(cherry picked from commit c4e561ee13)
This commit is contained in:
@@ -652,6 +652,12 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
|
||||
relic->RemoveFromWorld();
|
||||
m_titansRelicGUID.Clear();
|
||||
|
||||
// change collision wall state closed
|
||||
for (BfWGGameObjectBuilding* building : BuildingsInZone)
|
||||
{
|
||||
building->RebuildGate();
|
||||
}
|
||||
|
||||
// successful defense
|
||||
if (endByTimer)
|
||||
UpdateData(GetDefenderTeam() == TEAM_HORDE ? BATTLEFIELD_WG_DATA_DEF_H : BATTLEFIELD_WG_DATA_DEF_A, 1);
|
||||
@@ -1424,7 +1430,7 @@ void BfWGGameObjectBuilding::Rebuild()
|
||||
build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
|
||||
if (build->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
|
||||
if (GameObject* go = build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 50.0f))
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
// Update worldstate
|
||||
_state = WintergraspGameObjectState(BATTLEFIELD_WG_OBJECTSTATE_ALLIANCE_INTACT - (_teamControl * 3));
|
||||
@@ -1435,6 +1441,18 @@ void BfWGGameObjectBuilding::Rebuild()
|
||||
}
|
||||
}
|
||||
|
||||
void BfWGGameObjectBuilding::RebuildGate()
|
||||
{
|
||||
if (GameObject* build = _wg->GetGameObject(_buildGUID))
|
||||
{
|
||||
if (build->IsDestructibleBuilding() && build->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
|
||||
{
|
||||
if (GameObject* go = build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 50.0f))
|
||||
go->SetGoState(GO_STATE_READY); //not GO_STATE_ACTIVE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BfWGGameObjectBuilding::Damaged()
|
||||
{
|
||||
// Update worldstate
|
||||
|
||||
@@ -572,6 +572,7 @@ public:
|
||||
ObjectGuid const& GetGUID() const { return _buildGUID; }
|
||||
|
||||
void Rebuild();
|
||||
void RebuildGate();
|
||||
|
||||
// Called when associated gameobject is damaged
|
||||
void Damaged();
|
||||
|
||||
Reference in New Issue
Block a user