[Content Filtering] Updates contents flags to be checked at runtime. (#1940)

* Updates contents flags to be checked at runtime.

* Fix formatting

* Add expansion flags

* Tweaks to logic

* Logic tweaks

* Update world_content_service.cpp

* Inverse DoesPassContentFiltering logic

* Update world_content_service.cpp

* Update world_content_service.cpp

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Randy Girard
2022-03-06 23:02:57 -05:00
committed by GitHub
parent 25a19a13dc
commit 31ad0da811
7 changed files with 102 additions and 10 deletions
+10 -2
View File
@@ -51,8 +51,13 @@ void ZoneDatabase::AddLootTableToNPC(NPC* npc,uint32 loottable_id, ItemList* ite
}
lts = database.GetLootTable(loottable_id);
if (!lts)
if (!lts) {
return;
}
if (!content_service.DoesPassContentFiltering(lts->content_flags)) {
return;
}
uint32 min_cash = lts->mincash;
uint32 max_cash = lts->maxcash;
@@ -128,6 +133,10 @@ void ZoneDatabase::AddLootDropToNPC(NPC *npc, uint32 lootdrop_id, ItemList *item
return;
}
if (!content_service.DoesPassContentFiltering(loot_drop->content_flags)) {
return;
}
// if this lootdrop is droplimit=0 and mindrop 0, scan list once and return
if (droplimit == 0 && mindrop == 0) {
for (uint32 i = 0; i < loot_drop->NumEntries; ++i) {
@@ -706,4 +715,3 @@ void ZoneDatabase::LoadGlobalLoot()
zone->AddGlobalLootEntry(e);
}
}