diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-09-13 11:13:04 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-10-31 18:25:40 +0100 |
| commit | b8e86b9b7a0983b3bc610513531944e68c01c911 (patch) | |
| tree | 0fc521b0926310ae2bb90bae18c867e4b56e47b9 /src/server/scripts/Commands | |
| parent | a410072d6db23769bcf46609c2a540b545d10e73 (diff) | |
Core/DBLayer: Allowed using GetDouble for SUM results instead of requiring string conversions
(cherry picked from commit 3109ab2da08d094df97724355bff681d7951e576)
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index b22f56ef923..b81d6152c03 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -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; |
