UpdateBuyLine converted to QueryDatabase

This commit is contained in:
Arthur Ice 2014-08-20 19:28:53 -07:00
parent a7efa9d4e4
commit 41769a3fa8

View File

@ -778,14 +778,10 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity)
return; return;
} }
char errbuf[MYSQL_ERRMSG_SIZE]; std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot);
char* query = 0; auto results = QueryDatabase(query);
if (!results.Success())
if (!(RunQuery(query,MakeAnyLenString(&query, "update buyer set quantity=%i where charid=%i and buyslot=%i", _log(TRADING__CLIENT, "Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str());
Quantity, CharID, BuySlot), errbuf)))
_log(TRADING__CLIENT, "Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, errbuf);
safe_delete_array(query);
} }