mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 01:01:30 +00:00
SetSpecialAttkFlag converted to QueryDatabase
This commit is contained in:
parent
09332f6c26
commit
046da9efae
@ -383,21 +383,13 @@ bool ZoneDatabase::GetAccountInfoForLogin_result(MYSQL_RES* result, int16* admin
|
|||||||
|
|
||||||
|
|
||||||
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
|
||||||
uint32 affected_rows = 0;
|
|
||||||
|
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE npc_types SET npcspecialattks='%s' WHERE id=%i;",flag,id), errbuf, 0, &affected_rows)) {
|
std::string query = StringFormat("UPDATE npc_types SET npcspecialattks='%s' WHERE id = %i;", flag, id);
|
||||||
safe_delete_array(query);
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success())
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
if (affected_rows == 0) {
|
return results.RowsAffected() != 0;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::DoorIsOpen(uint8 door_id,const char* zone_name)
|
bool ZoneDatabase::DoorIsOpen(uint8 door_id,const char* zone_name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user