38c85f0a05e270366e596578fe193ad21bed1bcf
During bot destruction, the Player object may be destroyed before the BotAI destructor runs, causing _bot to become a dangling pointer. When UnsubscribeFromEventBuses() tries to access _bot->GetGUID(), it crashes with ACCESS_VIOLATION at GenericEventBus.h line 277. Fix: - Add _cachedBotGuid member to BotAI, initialized at construction - Add UnsubscribeByGuid() method to GenericEventBus template - Update UnsubscribeFromEventBuses() to use cached GUID directly via EventBus<T>::instance()->UnsubscribeByGuid(_cachedBotGuid) This ensures safe cleanup even when Player is already destroyed. Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: luis <[email protected]>
WowCommunityProject
Blizzlike WowCommunity project
Languages
C++
89.3%
C
10.1%
CMake
0.4%