mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 12:36:36 +00:00
Add hot_zone filtering for global loot
We do this in GlobalLootEntry::PassesRules since we want to check if the hot zone status changes during run time Value can be null, if null it's not checked. If the value is 0 the zone must not be a hot zone (I guess one might want that) and if it's not 0, the zone must be a hot zone
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include "global_loot_manager.h"
|
||||
#include "npc.h"
|
||||
#include "client.h"
|
||||
#include "zone.h"
|
||||
|
||||
extern Zone *zone;
|
||||
|
||||
std::vector<int> GlobalLootManager::GetGlobalLootTables(NPC *mob) const
|
||||
{
|
||||
@@ -78,6 +81,12 @@ bool GlobalLootEntry::PassesRules(NPC *mob) const
|
||||
if (mob->GetBodyType() == r.value)
|
||||
bPassesBodyType = true;
|
||||
break;
|
||||
case GlobalLoot::RuleTypes::HotZone: // value == 0 must not be hot_zone, value != must be hot_zone
|
||||
if (zone->IsHotzone() && !r.value)
|
||||
return false;
|
||||
if (!zone->IsHotzone() && r.value)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user