mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
[11355] Use ArenaType enum instead raw values
* Drop duplicate ArenaTeamTypes * Use enum type where appropriate * More strict check integrity arena team data at loading.
This commit is contained in:
parent
6f8aa617d0
commit
adcb84a325
12 changed files with 114 additions and 88 deletions
|
|
@ -496,7 +496,10 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
uint8 slot = ArenaTeam::GetSlotByType(type);
|
||||
if (!IsArenaTypeValid(ArenaType(type)))
|
||||
return;
|
||||
|
||||
uint8 slot = ArenaTeam::GetSlotByType(ArenaType(type));
|
||||
if(slot >= MAX_ARENA_SLOT)
|
||||
return;
|
||||
|
||||
|
|
@ -647,7 +650,10 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
|
|||
return;
|
||||
}
|
||||
|
||||
uint8 slot = ArenaTeam::GetSlotByType(type);
|
||||
if (!IsArenaTypeValid(ArenaType(type)))
|
||||
return;
|
||||
|
||||
uint8 slot = ArenaTeam::GetSlotByType(ArenaType(type));
|
||||
if(slot >= MAX_ARENA_SLOT)
|
||||
return;
|
||||
|
||||
|
|
@ -752,7 +758,10 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
|||
}
|
||||
else
|
||||
{
|
||||
uint8 slot = ArenaTeam::GetSlotByType(type);
|
||||
if (!IsArenaTypeValid(ArenaType(type)))
|
||||
return;
|
||||
|
||||
uint8 slot = ArenaTeam::GetSlotByType(ArenaType(type));
|
||||
if (slot >= MAX_ARENA_SLOT)
|
||||
return;
|
||||
|
||||
|
|
@ -844,7 +853,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data)
|
|||
else // or arena team
|
||||
{
|
||||
ArenaTeam* at = new ArenaTeam;
|
||||
if (!at->Create(_player->GetObjectGuid(), type, name))
|
||||
if (!at->Create(_player->GetObjectGuid(), ArenaType(type), name))
|
||||
{
|
||||
sLog.outError("PetitionsHandler: arena team create failed.");
|
||||
delete at;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue