Cache highest arena team/guild ids. Some code clean up.

This commit is contained in:
hunuza 2008-11-05 16:58:57 +01:00
parent 88b1974df6
commit 90828fa699
23 changed files with 183 additions and 160 deletions

View file

@ -57,13 +57,7 @@ bool ArenaTeam::create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
Name = ArenaTeamName;
Type = type;
QueryResult *result = CharacterDatabase.Query("SELECT MAX(arenateamid) FROM arena_team");
if( result )
{
Id = (*result)[0].GetUInt32()+1;
delete result;
}
else Id = 1;
Id = objmgr.GenerateArenaTeamId();
// ArenaTeamName already assigned to ArenaTeam::name, use it to encode string for DB
CharacterDatabase.escape_string(ArenaTeamName);