mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
[Loot] Remove from shared memory, simplification (#3988)
* First pass of pulling loot out of shared memory, functional * More code cleanup * More cleanup * More cleanup * More cleanup * Add loot reload type * Reload, logging * Update npc.h * Cleanup * Logging, don't load attempt to load loottable id 0 * Update worldserver.cpp * Update client.cpp * Update zone_loot.cpp * PR feedback * Update zone.cpp * Memory leak suggestion * Update CMakeLists.txt * Post rebase issues
This commit is contained in:
@@ -1747,6 +1747,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
|
||||
std::vector<uint32> npc_ids;
|
||||
std::vector<uint32> npc_faction_ids;
|
||||
std::vector<uint32> loottable_ids;
|
||||
|
||||
for (NpcTypesRepository::NpcTypes &n : NpcTypesRepository::GetWhere((Database &) content_db, filter)) {
|
||||
NPCType *t;
|
||||
@@ -1799,6 +1800,13 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
t->special_abilities[0] = '\0';
|
||||
}
|
||||
|
||||
if (n.loottable_id > 0) {
|
||||
// check if we already have this loottable_id before inserting it
|
||||
if (std::find(loottable_ids.begin(), loottable_ids.end(), n.loottable_id) == loottable_ids.end()) {
|
||||
loottable_ids.emplace_back(n.loottable_id);
|
||||
}
|
||||
}
|
||||
|
||||
t->npc_spells_id = n.npc_spells_id;
|
||||
t->npc_spells_effects_id = n.npc_spells_effects_id;
|
||||
t->d_melee_texture1 = n.d_melee_texture1;
|
||||
@@ -1984,6 +1992,8 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load
|
||||
zone->LoadNPCFactionAssociations(npc_faction_ids);
|
||||
}
|
||||
|
||||
zone->LoadLootTables(loottable_ids);
|
||||
|
||||
return npc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user