clang-format LoadZoneObjects

This commit is contained in:
Michael Cook (mackal) 2016-08-27 22:26:44 -04:00
parent aaa116d97c
commit 89183cf8b7

View File

@ -157,24 +157,23 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
}
//this really loads the objects into entity_list
bool Zone::LoadZoneObjects() {
std::string query = StringFormat("SELECT id, zoneid, xpos, ypos, zpos, heading, "
"itemid, charges, objectname, type, icon, unknown08, "
"unknown10, unknown20, unknown24, unknown76, size, tilt_x, "
"tilt_y, display_name FROM object "
"WHERE zoneid = %i AND (version = %u OR version = -1)",
bool Zone::LoadZoneObjects()
{
std::string query =
StringFormat("SELECT id, zoneid, xpos, ypos, zpos, heading, itemid, charges, objectname, type, icon, "
"unknown08, unknown10, unknown20, unknown24, unknown76, size, tilt_x, tilt_y, display_name "
"FROM object WHERE zoneid = %i AND (version = %u OR version = -1)",
zoneid, instanceversion);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log.Out(Logs::General, Logs::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str());
Log.Out(Logs::General, Logs::Error, "Error Loading Objects from DB: %s",
results.ErrorMessage().c_str());
return false;
}
Log.Out(Logs::General, Logs::Status, "Loading Objects from DB...");
for (auto row = results.begin(); row != results.end(); ++row) {
if (atoi(row[9]) == 0)
{
if (atoi(row[9]) == 0) {
// Type == 0 - Static Object
const char *shortname = database.GetZoneName(atoi(row[1]), false); // zoneid -> zone_shortname
@ -258,8 +257,7 @@ bool Zone::LoadZoneObjects() {
if (itemid == 0) {
// Generic tradeskill container
inst = new ItemInst(ItemInstWorldContainer);
}
else {
} else {
// Groundspawn object
inst = database.CreateItem(itemid);
}