[9880] Prepare world state inint packet data in more clean way.

* Avoid use hardcoded field amount values
* Avoid use world state update packets just after world state init packet
* Attempt make code look less horrible in general.
This commit is contained in:
VladimirMangos 2010-05-12 09:24:57 +04:00
parent d3c34e93c9
commit fecf6fdb72
18 changed files with 441 additions and 427 deletions

View file

@ -131,11 +131,11 @@ void BattleGroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
// HandleTriggerBuff(buff_guid,Source);
}
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data)
void BattleGroundNA::FillInitialWorldStates(WorldPacket &data, uint32& count)
{
data << uint32(0xa0f) << uint32(GetAlivePlayersCountByTeam(ALLIANCE)); // 7
data << uint32(0xa10) << uint32(GetAlivePlayersCountByTeam(HORDE)); // 8
data << uint32(0xa11) << uint32(1); // 9
FillInitialWorldState(data, count, 0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
FillInitialWorldState(data, count, 0xa10, GetAlivePlayersCountByTeam(HORDE));
FillInitialWorldState(data, count, 0xa11, 1);
}
void BattleGroundNA::Reset()