mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
DisableRecipe converted to QueryDatabase
This commit is contained in:
parent
6221c1f8ab
commit
e338f801ea
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user