From 422f3b1ce91abd67619f63265130cdef669ed2ad Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Thu, 10 Jul 2014 14:57:24 -0700 Subject: [PATCH] GetSkillCap converted to StringFormat --- common/database.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 0c2949ebb..2b7480ac9 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1460,11 +1460,11 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 { uint8 skill_level = 0, skill_formula = 0; uint16 base_cap = 0, skill_cap = 0, skill_cap2 = 0, skill_cap3 = 0; - char *query = nullptr; + //Fetch the data from DB. - auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT level, formula, pre50cap, post50cap, post60cap from skillcaps where skill = %i && class = %i", skillid, in_class)); - safe_delete_array(query); + std::string query = StringFormat("SELECT level, formula, pre50cap, post50cap, post60cap from skillcaps where skill = %i && class = %i", skillid, in_class); + auto results = QueryDatabase(query); if (results.Success() && results.RowsAffected() != 0) {