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
Owner

Root cause of testing showing Titanium Vein/Northrend herbs in Un'Goro Crater after the v2 zone-resources feature merged.

SelectSiteForPlayer() anchors on a live player's position first (the common case -- there's almost always someone online), via BuildEligibleSiteFromPlayer -> BuildSiteFromAnchor. That function only reads the player's live zone/area IDs from world state -- it never looks up the matching NodeEntries/BonusEntries that BuildSites() parsed from GoldRush.ZonePool into _sites. So every player-anchored event got empty resource pools and fell back to global, regardless of ZonePool config -- only the (much rarer) no-eligible-player fallback path, which picks randomly from _sites directly, ever got real zone-specific resources.

Fix: after building the site from the player's position, look up a matching _sites entry by ZoneId and inherit its resource pools. Zones that are eligible anchors but have no _sites entry still correctly fall through to the global pool -- that was never broken.

Root cause of testing showing Titanium Vein/Northrend herbs in Un'Goro Crater after the v2 zone-resources feature merged. `SelectSiteForPlayer()` anchors on a live player's position first (the common case -- there's almost always someone online), via `BuildEligibleSiteFromPlayer` -> `BuildSiteFromAnchor`. That function only reads the player's live zone/area IDs from world state -- it never looks up the matching `NodeEntries`/`BonusEntries` that `BuildSites()` parsed from `GoldRush.ZonePool` into `_sites`. So every player-anchored event got empty resource pools and fell back to global, regardless of ZonePool config -- only the (much rarer) no-eligible-player fallback path, which picks randomly from `_sites` directly, ever got real zone-specific resources. Fix: after building the site from the player's position, look up a matching `_sites` entry by `ZoneId` and inherit its resource pools. Zones that are eligible anchors but have no `_sites` entry still correctly fall through to the global pool -- that was never broken.
yrtria added 1 commit 2026-09-04 18:11:18 -06:00
SelectSiteForPlayer() tries to anchor an event on a live player's
current position FIRST (BuildEligibleSiteFromPlayer ->
BuildSiteFromAnchor), only falling back to a random pick from _sites
when no eligible player is available. Since there is almost always
an eligible player online, this is the common path in practice --
but BuildSiteFromAnchor only reads the player's live zone/area IDs
from the world state; it has no access to the NodeEntries/
BonusEntries that BuildSites() parsed from GoldRush.ZonePool into
_sites. Every player-anchored event therefore got an empty
NodeEntries/BonusEntries regardless of ZonePool configuration, and
SpawnHotspot()'s (correct, intentional) fallback-to-global-pool logic
silently kicked in every time.

This is why testing in Un'Goro Crater after the v2 zone-resources
feature shipped still produced Titanium Vein and Northrend herbs --
the module correctly identified the player's zone as Un'Goro
(ZoneId/ZoneLabel were right), it just never looked up Un'Goro's
configured resource pool to attach it to that site.

Fix: after building the site from the player's live position, look
up a matching entry in _sites by ZoneId and inherit its NodeEntries/
BonusEntries. A zone that's an eligible anchor but has no configured
entry in _sites still correctly falls through to the global pool --
that fallback path was never the problem, only the missing lookup
for zones that ARE configured.
yrtria merged commit fa79526eb6 into main 2026-09-04 18:13:16 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: yrtria/mod-gold-rush#6
No description provided.