DisableRecipe converted to QueryDatabase

This commit is contained in:
Arthur Ice 2014-10-08 16:05:52 -07:00
parent 6221c1f8ab
commit e338f801ea

View File

@ -1522,16 +1522,11 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id)
bool ZoneDatabase::DisableRecipe(uint32 recipe_id) bool ZoneDatabase::DisableRecipe(uint32 recipe_id)
{ {
char *query = 0; std::string query = StringFormat("UPDATE tradeskill_recipe SET enabled = 0 "
uint32 qlen; "WHERE id = %u;", recipe_id);
char errbuf[MYSQL_ERRMSG_SIZE]; auto results = QueryDatabase(query);
uint32 affected_rows = 0; if (!results.Success())
LogFile->write(EQEMuLog::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str());
qlen = MakeAnyLenString(&query, "UPDATE tradeskill_recipe SET enabled = 0 WHERE id = %u;", recipe_id); return results.RowsAffected() > 0;
if (!RunQuery(query, qlen, errbuf, 0, &affected_rows)) {
LogFile->write(EQEMuLog::Error, "Error in DisableRecipe query '%s': %s", query, errbuf);
}
safe_delete_array(query);
return (affected_rows > 0);
} }