diff --git a/zone/groups.cpp b/zone/groups.cpp index 5033d344c..4ed4fc41f 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1571,15 +1571,11 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) // informing them of the change and update the group_leaders table. // if(OldMainTankName == MainTankName) { - char errbuff[MYSQL_ERRMSG_SIZE]; - char *Query = 0; - - if (!database.RunQuery(Query, MakeAnyLenString(&Query, "UPDATE group_leaders SET maintank='' WHERE gid=%i LIMIT 1", - GetID()), errbuff)) - LogFile->write(EQEMuLog::Error, "Unable to clear group main tank: %s\n", errbuff); - - safe_delete_array(Query); + std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); + auto results = database.QueryDatabase(query); + if (!results.Success()) + LogFile->write(EQEMuLog::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) {