From bc90ab795bd571369a74fc651bfd40080b0a31a9 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Wed, 20 Aug 2014 12:55:53 -0700 Subject: [PATCH] ClearZoneFlag converted to QueryDatabase --- zone/zoning.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 565ebf8d2..de1f73193 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -736,16 +736,12 @@ void Client::ClearZoneFlag(uint32 zone_id) { zone_flags.erase(zone_id); - //update the DB - char errbuf[MYSQL_ERRMSG_SIZE]; - char *query = 0; - // Retrieve all waypoints for this grid - if(!database.RunQuery(query,MakeAnyLenString(&query, - "DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", - CharacterID(),zone_id),errbuf)) { - LogFile->write(EQEMuLog::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), errbuf); - } + std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); + auto results = database.QueryDatabase(query); + if(!results.Success()) + LogFile->write(EQEMuLog::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + } void Client::LoadZoneFlags() {