Skip to content

Commit

Permalink
Core/CharacterHandler: Fix ¨[ERROR] GetUInt32() on non-numeric field¨…
Browse files Browse the repository at this point in the history
… on a certain query.

Author: toshik.777
Closes issue #5068

--HG--
branch : trunk
  • Loading branch information
Machiavelli committed Dec 14, 2010
1 parent 9a806e6 commit 3b0297f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
return;
}

QueryResult resultacct = LoginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
QueryResult resultacct = LoginDatabase.PQuery("SELECT IFNULL(SUM(numchars), 0) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
if (resultacct)
{
Field *fields=resultacct->Fetch();
Field *fields = resultacct->Fetch();
uint32 acctcharcount = fields[0].GetUInt32();

if (acctcharcount >= sWorld.getIntConfig(CONFIG_CHARACTERS_PER_ACCOUNT))
Expand Down

0 comments on commit 3b0297f

Please sign in to comment.