Fix bot routing no-op, 1000x node lifetime, reload orphaning, floating spawns, and empty-server scheduling #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/review-round-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the four defects found reviewing upstream
Old-Man-Warcraft/mod-gold-rush(last upstream commit 2026-04-01) against this server's AzerothCoreefe123faband mod-playerbots8d9f6aa6, both 2026-08-14.Fixed
1. Bot routing was a silent no-op.
Engine::ChangeStrategydispatches onname[0]and only acts on+,-,~,?. The bare"new rpg"fell through every case. Bots still drifted to the hotspot, but only becauserpgInfo.ChangeToGoGrind()works andAiFactory.cpp:615already grants the strategy whenAiPlayerbot.EnableNewRpgStrategyis on (it is, on this server). Now"+new rpg", non-combat engine only.2. Node lifetime off by 1000x.
Map::SummonGameObject'srespawnTimereachesGameObject::SetRespawnTime(int32)-- seconds. PassingDurationMsgave every node a ~13.9 day life, so nothing self-expired.3. Config reload orphaned nodes.
LoadConfigwiped_spawnedNodesand_activewithout despawning. With defect 2 in play, a.reload configmid-event left 15-25 gathering nodes in the world for two weeks.4. No terrain height on spawn. Every node reused the anchor's exact Z. On Un'Goro / Winterspring / Sholazar -- the hilly zones in the default pool -- a good fraction floated or sank. Now probes ground height, rejects >20y drift, requires LOS from the anchor, retries up to 8 times per node.
Also changed
DespawnHotspotNodesresolves the map once instead of per node, and warns when it can'tSetRespawnTime/SetSpawnedByDefaultafterMap::SummonGameObjectVerification
clang++ -fsyntax-onlyagainst the live build's own compile flags plus the mod-playerbots include tree: clean. Not yet built or run -- that needs a worldserver relink.Scheduler behaviour on an empty server (commit 2)
The module does fail gracefully with nobody online -- no crash, no spawns, no announcement,
_activenever set. But the bail-out path had a pacing bug worth fixing.Every failed scheduled start overwrote the rolled
Min/MaxIntervalwith a hard-coded 5 minutes and never restored it. On a server that sits empty this degenerates into a permanent 5-minute poll, so the first player to log in gets an event fired within one retry window, anchored on their exact position, with a server-wide announcement. Login ambush rather than a scheduled world event. It also wrote a retry line togold-rush.logevery 5 minutes indefinitely, sinceDebugdefaults to 1.StartEventnow counts eligible anchors when the schedule expires, holds without consuming the interval while belowMinPlayersOnline, and inserts a grace period once the world repopulates. The count runs only on schedule expiry, never per world tick.New config keys:
GoldRush.RetryMinutesGoldRush.GraceMinutesGoldRush.MinPlayersOnline.goldrush startand.goldrush teststartpassscheduled=falseand bypass both gates, so GM testing is unaffected.Deliberately not fixed
ZonePoolis largely advisory.SelectSiteForPlayerprefers the anchor's current zone, andIsEligibleAnchorcounts bots as players, so with no humans online the event fires wherever a random bot is standing -- possibly a low-level zone that then gets 25 Titanium Veins. This is upstream's intended "loosened eligibility" behaviour; changing it is a design decision, not a bug fix.vein,lotus,clover,thorn,bloom). It catches all five defaults by luck, but only Titanium Vein classifies as ore, so the alternation yields ~50% Titanium Vein / 50% mixed herbs. Add Saronite Deposit or Adder's Tongue and they fall silently to the fallback pool.bot->GetLevel() < 80is hard-coded, correct for the default 450-skill node set but it won't follow ifNodeEntrieschanges.IsHotspotNodeEntryis dead code -- defined, never called.SpawnRadiusYards = 25with 15-25 nodes is roughly one node every 2-3 yards. Worth raising to 60-80 in config; left alone here so the default matches upstream.Fix bot routing no-op, 1000x node lifetime, reload orphaning, and floating spawnsto Fix bot routing no-op, 1000x node lifetime, reload orphaning, floating spawns, and empty-server scheduling