UndelegateMainTank converted to QueryDatabase

This commit is contained in:
Arthur Ice 2014-09-05 15:54:07 -07:00
parent 99fe610f72
commit b525a32b6e

View File

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