mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Cache highest arena team/guild ids. Some code clean up.
This commit is contained in:
parent
88b1974df6
commit
90828fa699
23 changed files with 183 additions and 160 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue