Core/Battlefield: Small cleanup

This commit is contained in:
Vincent-Michael
2012-08-27 22:58:45 +02:00
parent 9a11dc5ea6
commit c4f011f332
2 changed files with 14 additions and 13 deletions

View File

@@ -25,12 +25,6 @@
#include "SpellAuras.h"
#include "Vehicle.h"
enum WintergrastData
{
BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp
BATTLEFIELD_WG_MAPID = 571, // Northrend
};
enum WGVehicles
{
NPC_WG_SEIGE_ENGINE_ALLIANCE = 28312,
@@ -178,7 +172,7 @@ bool BattlefieldWG::SetupBattlefield()
GameObject* go = SpawnGameObject(WGGameObjectBuilding[i].entry, WGGameObjectBuilding[i].x, WGGameObjectBuilding[i].y, WGGameObjectBuilding[i].z, WGGameObjectBuilding[i].o);
BfWGGameObjectBuilding* b = new BfWGGameObjectBuilding(this);
b->Init(go, WGGameObjectBuilding[i].type, WGGameObjectBuilding[i].WorldState, WGGameObjectBuilding[i].nameId);
if (!m_IsEnabled && go->GetGOInfo()->entry == GO_WINTERGRASP_VAULT_GATE)
if (!IsEnabled() && go->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
BuildingsInZone.insert(b);
}

View File

@@ -44,6 +44,12 @@ typedef std::set<WGWorkshop*> Workshop;
typedef std::set<Group*> GroupSet;
//typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ?
enum WintergrastData
{
BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp
BATTLEFIELD_WG_MAPID = 571, // Northrend
};
enum WintergraspSpells
{
// Wartime auras
@@ -435,7 +441,6 @@ class BattlefieldWG : public Battlefield
GameObject* m_titansRelic;
};
uint32 const NORTHREND_WINTERGRASP = 4197;
uint8 const WG_MAX_OBJ = 32;
uint8 const WG_KEEPGAMEOBJECT_MAX = 44;
uint8 const WG_MAX_TURRET = 15;
@@ -544,6 +549,8 @@ enum WintergraspGameObject
GO_WINTERGRASP_FORTRESS_GATE = 190375,
GO_WINTERGRASP_VAULT_GATE = 191810,
GO_WINTERGRASP_KEEP_COLLISION_WALL = 194323,
};
struct WintergraspObjectPositionData
@@ -1201,7 +1208,7 @@ struct BfWGGameObjectBuilding
{
m_Build->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
if (m_Build->GetEntry() == GO_WINTERGRASP_VAULT_GATE)
if (GameObject * go = m_Build->FindNearestGameObject(194323, 10.0f))
if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f))
go->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, NULL, true);
// Update worldstate
@@ -1258,7 +1265,7 @@ struct BfWGGameObjectBuilding
m_WG->UpdatedDestroyedTowerCount(TeamId(m_Team));
break;
case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
if (GameObject* go = m_Build->FindNearestGameObject(194323, 10.0f))
if (GameObject* go = m_Build->FindNearestGameObject(GO_WINTERGRASP_KEEP_COLLISION_WALL, 10.0f))
go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED);
m_WG->SetRelicInteractible(true);
if (m_WG->GetRelic())
@@ -1413,7 +1420,7 @@ struct BfWGGameObjectBuilding
{
Position towerCannonPos;
TowerCannon[towerid].TurretTop[i].GetPosition(&towerCannonPos);
if (Creature *turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0)))
if (Creature* turret = m_WG->SpawnCreature(28366, towerCannonPos, TeamId(0)))
{
m_TurretTopList.insert(turret->GetGUID());
switch (go->GetEntry())
@@ -1653,9 +1660,9 @@ struct WintergraspWorkshopData
// Spawning Associate gameobject and store them
void AddGameObject(WintergraspObjectPositionData obj)
{
if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o))
if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o))
m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject);
if (GameObject *gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o))
if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryAlliance, obj.x, obj.y, obj.z, obj.o))
m_GameObjectOnPoint[TEAM_ALLIANCE].insert(gameobject);
}