Core/Battleground: Some (minor) code optimizations

- All access to Battleground vars are done using funtions (Remove friendship from Battleground and BattlegroundMgr)
- Move specific 47 mins arena check to battleground code as its generic to all arenas
- Create PreUpdateImpl and PostUpdateImpl functions. Specific battlegrounds will implement those if needed (No more need of call Battleground::Update inside specific BGs)
- Modify Create function to use only one parameter
- Remove EventPlayerCapturedFlag from Battleground class, only one BG implements it and it's not used outside that BG.
This commit is contained in:
Spp
2011-08-05 11:57:09 +02:00
parent d7715fa4b8
commit 4ecda557e4
33 changed files with 299 additions and 336 deletions
@@ -44,20 +44,6 @@ BattlegroundBE::~BattlegroundBE()
}
void BattlegroundBE::Update(uint32 diff)
{
Battleground::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
{
UpdateArenaWorldState();
CheckArenaAfterTimerConditions();
}
}
}
void BattlegroundBE::StartingEventCloseDoors()
{
for (uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; ++i)
@@ -127,7 +113,7 @@ void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
//uint32 SpellId = 0;
//uint64 buff_guid = 0;
switch(Trigger)
switch (Trigger)
{
case 4538: // buff trigger?
//buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_1];