Core/DBLayer: Allowed using GetDouble for SUM results instead of requiring string conversions
(cherry picked from commit 3109ab2da08d094df97724355bff681d7951e576)
This commit is contained in:
1 parent
a410072d6d
commit
b8e86b9b7a
3 files changed
+37
-18
No files matched your search
@@ -1773,21 +1773,13 @@ public:
|
||||
PreparedQueryResult result6 = CharacterDatabase.Query(stmt4);
|
||||
if (result6)
|
||||
{
|
||||
// Define the variables, so the compiler knows they exist
|
||||
uint32 rmailint = 0;
|
||||
|
||||
// Fetch the fields - readmail is a SUM(x) and given out as char! Thus...
|
||||
// ... while totalmail is a COUNT(x), which is given out as INt64, which we just convert on fetch...
|
||||
Field* fields = result6->Fetch();
|
||||
std::string readmail = fields[0].GetString();
|
||||
uint32 readmail = uint32(fields[0].GetDouble());
|
||||
uint32 totalmail = uint32(fields[1].GetUInt64());
|
||||
|
||||
// ... we have to convert it from Char to int. We can use totalmail as it is
|
||||
rmailint = atoul(readmail.c_str());
|
||||
|
||||
// Output XXI. LANG_INFO_CHR_MAILS if at least one mail is given
|
||||
if (totalmail >= 1)
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, rmailint, totalmail);
|
||||
handler->PSendSysMessage(LANG_PINFO_CHR_MAILS, readmail, totalmail);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user