[10379] More wide use ObjectGuid in arena team code.

As always in this commits line fixes for uint32->uint64 guid assigns.
This commit is contained in:
VladimirMangos 2010-08-19 11:21:00 +04:00
parent 9b3d37f0cf
commit 5fd06abf44
9 changed files with 138 additions and 139 deletions

View file

@ -6617,10 +6617,10 @@ uint32 Player::GetRankFromDB(uint64 guid)
return 0;
}
uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
uint32 Player::GetArenaTeamIdFromDB(ObjectGuid guid, uint8 type)
{
QueryResult *result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", GUID_LOPART(guid), type);
if(!result)
QueryResult *result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", guid.GetCounter(), type);
if (!result)
return 0;
uint32 id = (*result)[0].GetUInt32();
@ -14899,7 +14899,7 @@ void Player::_LoadArenaTeamInfo(QueryResult *result)
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_ID, arenateamid);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_TYPE, aTeam->GetType());
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (aTeam->GetCaptain() == GetGUID()) ? 0 : 1);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (aTeam->GetCaptainGuid() == GetObjectGuid()) ? 0 : 1);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, played_week);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_SEASON, played_season);
SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, wons_season);
@ -15136,11 +15136,11 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
for(uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot)
{
uint32 arena_team_id = GetArenaTeamId(arena_slot);
if(!arena_team_id)
if (!arena_team_id)
continue;
if(ArenaTeam * at = sObjectMgr.GetArenaTeamById(arena_team_id))
if(at->HaveMember(GetGUID()))
if (ArenaTeam * at = sObjectMgr.GetArenaTeamById(arena_team_id))
if (at->HaveMember(GetObjectGuid()))
continue;
// arena team not exist or not member, cleanup fields
@ -18107,13 +18107,10 @@ void Player::LeaveAllArenaTeams(ObjectGuid guid)
do
{
Field *fields = result->Fetch();
uint32 at_id = fields[0].GetUInt32();
if(at_id != 0)
{
ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id);
if(at)
at->DelMember(guid.GetRawValue());
}
if (uint32 at_id = fields[0].GetUInt32())
if (ArenaTeam * at = sObjectMgr.GetArenaTeamById(at_id))
at->DelMember(guid);
} while (result->NextRow());
delete result;