mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-01 03:02:26 +00:00
Fix container interaction [skip ci]
This commit is contained in:
parent
bcd62b76c4
commit
b8c44ee41b
@ -652,9 +652,10 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save container contents, if container
|
// Save container contents, if container
|
||||||
if (inst && inst->IsType(EQEmu::item::ItemClassBag))
|
if (inst && inst->IsType(EQEmu::item::ItemClassBag)) {
|
||||||
SaveWorldContainer(object.zone_id, database_id, inst);
|
SaveWorldContainer(object.zone_id, database_id, inst);
|
||||||
|
}
|
||||||
|
|
||||||
return database_id;
|
return database_id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -755,27 +755,37 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const EQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string query = StringFormat("REPLACE INTO object_contents "
|
std::string query = StringFormat(
|
||||||
"(zoneid, parentid, bagidx, itemid, charges, "
|
"REPLACE INTO object_contents "
|
||||||
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, droptime) "
|
"(zoneid, parentid, bagidx, itemid, charges, "
|
||||||
"VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())",
|
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, droptime) "
|
||||||
zone_id, parent_id, index, item_id, inst->GetCharges(),
|
"VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())",
|
||||||
augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]);
|
zone_id, parent_id, index, item_id, inst->GetCharges(),
|
||||||
auto results = QueryDatabase(query);
|
augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]
|
||||||
if (!results.Success())
|
);
|
||||||
LogError("Error in ZoneDatabase::SaveWorldContainer: [{}]", results.ErrorMessage().c_str());
|
|
||||||
|
|
||||||
}
|
auto results = database.QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
|
LogError("Error in ZoneDatabase::SaveWorldContainer: [{}]", results.ErrorMessage().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove all child objects inside a world container (i.e., forge, bag dropped to ground, etc)
|
// Remove all child objects inside a world container (i.e., forge, bag dropped to ground, etc)
|
||||||
void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id)
|
void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id);
|
std::string query = StringFormat(
|
||||||
auto results = QueryDatabase(query);
|
"DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i",
|
||||||
if (!results.Success())
|
parent_id,
|
||||||
|
zone_id
|
||||||
|
);
|
||||||
|
|
||||||
|
auto results = database.QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
LogError("Error in ZoneDatabase::DeleteWorldContainer: [{}]", results.ErrorMessage().c_str());
|
LogError("Error in ZoneDatabase::DeleteWorldContainer: [{}]", results.ErrorMessage().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user