fix: player-anchored events never got zone-specific resources #6

Merged
yrtria merged 1 commit from fix/player-anchored-site-missing-zone-resources into main 2026-09-04 18:13:16 -06:00

View file

@ -487,7 +487,29 @@ private:
if (!IsEligibleAnchor(player))
return {};
return BuildSiteFromAnchor(player);
GoldRushSite site = BuildSiteFromAnchor(player);
// BuildSiteFromAnchor only knows the player's live zone/area IDs -- it has
// no access to the per-zone NodeEntries/BonusEntries parsed from
// GoldRush.ZonePool into _sites. SelectSiteForPlayer() tries a player
// anchor FIRST and only falls back to picking randomly from _sites when no
// eligible player is available, so without this lookup, the common case
// (a live player standing in a configured zone) silently lost its
// zone-specific resources and fell back to the global pool every time --
// exactly the bug reported after the v2 zone-resources feature shipped:
// events kept spawning the default Northrend-flavored global pool
// regardless of which zone they were actually anchored in.
for (GoldRushSite const& configured : _sites)
{
if (configured.ZoneId == site.ZoneId)
{
site.NodeEntries = configured.NodeEntries;
site.BonusEntries = configured.BonusEntries;
break;
}
}
return site;
}
std::vector<GoldRushSite> BuildSites(std::string const& zones) const