Fixes a thread safety issue where multiple bots dying in battlegrounds
simultaneously would corrupt the shared static unordered_map, causing
segmentation faults.
Changes:
- Remove: static m_botReleaseTimes map from AutoReleaseSpiritAction
- Add: bgReleaseAttemptTime member to PlayerbotAI (per-bot storage)
- Update: All references to use per-bot storage instead of static map
Why this fixes the crash:
- Each PlayerbotAI instance is accessed by only one map update thread
- No cross-thread access to shared data structures
- No mutex/locking required - thread-safe by design
- Automatic cleanup when bot is destroyed
Thread-safe solution: Per-bot state eliminates race conditions without
performance overhead.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add PLAYERHOOK_ON_BEFORE_TELEPORT to proactively clean visibility
references when a bot teleports between maps. This prevents a race
condition where:
1. Bot A teleports and its visible objects start getting cleaned up
2. Bot B is simultaneously updating visibility and tries to access
objects in Bot A's old visibility map
3. Those objects may already be freed, causing a segmentation fault
at GridNotifiers.cpp:65 in IsWorldObjectOutOfSightRange()
The fix only affects bots to avoid changing behavior for real players.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Maintenance config controls
bools in config
* Update TrainerAction.cpp
removed some note-to-selfs (personal config preferences)
* Set default to true
Also tidied up some comments
* Update playerbots.conf.dist
* Reorganised
Changed the description in conf to be less conversational.
Rearranged the order that options are arranged, grouping by what made sense to me (the type of gameplay made easier/skipped by the option being enabled).
Rearranged the order the variables and method calls are listed in the code to match the order they are presented in the conf to make future maintenance of maintenance (:P) more intuitive.
* Update playerbots.conf.dist
Revert previous commit (change to call order in MaintenanceAction::Execute)
conf settings grouped
Add RemoveAurasWithInterruptFlags call before all TeleportTo operations
to prevent race condition crash in battlegrounds.
The crash occurs when area auras (like "Entering Battleground") are
queued for removal in Aura::UpdateTargetMap's targetsToRemove list,
but the unit is deleted before the 500ms update cycle completes,
causing SIGSEGV when accessing the dangling pointer.
This fix removes auras with AURA_INTERRUPT_FLAG_TELEPORTED and
AURA_INTERRUPT_FLAG_CHANGE_MAP before teleporting, matching the
behavior in Player::TeleportTo for real players.
Affected locations:
- BattleGround join/teleport
- Spirit healer/graveyard teleport
- Corpse resurrection teleport
- Meeting stone teleport
- Master follow teleport
- RPG unstuck teleport
- Random bot teleport
- Chat command teleport
Raid-specific teleports excluded as they require separate testing.
* Fix Issue #1648
Fix low level randombot shamans (~34) don't heal in dungeongroups, seems new "resto" strategy is broken #1648
* Final working fix, tested with all 3 shaman class specs.
* Update asked by review
* requested review changes
* Minor corrections of the cpp file
* boyscouting
Lets try and leave the code cleaner behind as we find it when we can.
* Oupsie fix ;)
---------
Co-authored-by: bash <31279994+hermensbas@users.noreply.github.com>