Wintergrasp Fix Collision Wall work: Open / Close collision wall when battle started/ended
Port From (https://github.com/TrinityCore/TrinityCore/commit/e79cb1da2cd8b905d2103df548e298656684c9dd)
This commit is contained in:
@@ -281,6 +281,10 @@ namespace Game.BattleFields
|
|||||||
}
|
}
|
||||||
m_titansRelicGUID.Clear();
|
m_titansRelicGUID.Clear();
|
||||||
|
|
||||||
|
// change collision wall state closed
|
||||||
|
foreach (BfWGGameObjectBuilding building in BuildingsInZone)
|
||||||
|
building.RebuildGate();
|
||||||
|
|
||||||
// successful defense
|
// successful defense
|
||||||
if (endByTimer)
|
if (endByTimer)
|
||||||
UpdateData(GetDefenderTeam() == TeamId.Horde ? WGData.DefH : WGData.DefA, 1);
|
UpdateData(GetDefenderTeam() == TeamId.Horde ? WGData.DefH : WGData.DefA, 1);
|
||||||
@@ -1090,7 +1094,7 @@ namespace Game.BattleFields
|
|||||||
{
|
{
|
||||||
GameObject go = build.FindNearestGameObject(WGGameObjects.KeepCollisionWall, 50.0f);
|
GameObject go = build.FindNearestGameObject(WGGameObjects.KeepCollisionWall, 50.0f);
|
||||||
if (go)
|
if (go)
|
||||||
go.SetGoState(GameObjectState.Ready);
|
go.SetGoState(GameObjectState.Active);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update worldstate
|
// Update worldstate
|
||||||
@@ -1102,6 +1106,20 @@ namespace Game.BattleFields
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RebuildGate()
|
||||||
|
{
|
||||||
|
GameObject build = _wg.GetGameObject(_buildGUID);
|
||||||
|
if (build != null)
|
||||||
|
{
|
||||||
|
if (build.IsDestructibleBuilding() && build.GetEntry() == WGGameObjects.VaultGate)
|
||||||
|
{
|
||||||
|
GameObject go = build.FindNearestGameObject(WGGameObjects.KeepCollisionWall, 50.0f);
|
||||||
|
if (go != null)
|
||||||
|
go.SetGoState(GameObjectState.Ready); //not GO_STATE_ACTIVE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Called when associated gameobject is damaged
|
// Called when associated gameobject is damaged
|
||||||
public void Damaged()
|
public void Damaged()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user