diff --git a/src/game/Formulas.h b/src/game/Formulas.h index 5ba6ffdbb..43e77d333 100644 --- a/src/game/Formulas.h +++ b/src/game/Formulas.h @@ -27,7 +27,7 @@ namespace MaNGOS { inline uint32 hk_honor_at_level(uint32 level, uint32 count=1) { - return ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f ))); + return (uint32)ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f ))); } } namespace XP diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index 79fdb492a..ace7d97ec 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -64,8 +64,6 @@ void WorldSession::HandleGMTicketUpdateTextOpcode( WorldPacket & recv_data ) std::string ticketText; recv_data >> ticketText; - CharacterDatabase.escape_string(ticketText); - if(GMTicket* ticket = ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) ticket->SetText(ticketText.c_str()); else @@ -103,8 +101,6 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) sLog.outDebug("TicketCreate: map %u, x %f, y %f, z %f, text %s, unk1 %u, unk2 %u", map, x, y, z, ticketText.c_str(), unk1, unk2); - CharacterDatabase.escape_string(ticketText); - if(ticketmgr.GetGMTicket(GetPlayer()->GetGUIDLow())) { WorldPacket data( SMSG_GMTICKET_CREATE, 4 ); diff --git a/src/game/GMTicketMgr.h b/src/game/GMTicketMgr.h index 6425c6865..01e00874d 100644 --- a/src/game/GMTicketMgr.h +++ b/src/game/GMTicketMgr.h @@ -50,7 +50,10 @@ class GMTicket { m_text = text ? text : ""; m_lastUpdate = time(NULL); - CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", m_text.c_str(), m_guid); + + std::string escapedString = m_text; + CharacterDatabase.escape_string(escapedString); + CharacterDatabase.PExecute("UPDATE character_ticket SET ticket_text = '%s' WHERE guid = '%u'", escapedString.c_str(), m_guid); } void DeleteFromDB() const @@ -62,7 +65,11 @@ class GMTicket { CharacterDatabase.BeginTransaction(); DeleteFromDB(); - CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, GetText()); + + std::string escapedString = m_text; + CharacterDatabase.escape_string(escapedString); + + CharacterDatabase.PExecute("INSERT INTO character_ticket (guid, ticket_text) VALUES ('%u', '%s')", m_guid, escapedString.c_str()); CharacterDatabase.CommitTransaction(); } private: @@ -115,4 +122,4 @@ class GMTicketMgr }; #define ticketmgr MaNGOS::Singleton::Instance() -#endif \ No newline at end of file +#endif diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c4f3c9932..b39349b28 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "6839" + #define REVISION_NR "6840" #endif // __REVISION_NR_H__