diff options
| author | Shauren <shauren.trinity@gmail.com> | 2015-09-13 11:13:04 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-09-13 11:13:04 +0200 |
| commit | 3109ab2da08d094df97724355bff681d7951e576 (patch) | |
| tree | 39696b90d0ed3dc68668f7066f62a8e57bb2da7d /src/server/scripts | |
| parent | f515e9ea67ae97affebba1aef765f8e8962541d4 (diff) | |
Core/DBLayer: Allowed using GetDouble for SUM results instead of requiring string conversions
Diffstat (limited to 'src/server/scripts')
| -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 1be4b3c51a8..400ef88ff67 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1795,21 +1795,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; |
