Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(SoloCraft): Limit XP modification to instances only (#49)
## Changes Proposed This PR addresses an issue in the SoloCraft module where XP modification was being applied to all players, regardless of whether they were in an instance or not. The changes include: 1. Implemented a system to track whether players are in instances or not. 2. Modified the XP calculation to only apply when players are in instances (dungeons or raids). 3. Fixed build errors related to the use of ObjectGuid. ## Implementation Details - Added a `std::map<ObjectGuid, bool>` to track players' instance status. - Implemented `OnMapChanged` to update players' instance status. - Modified `OnGiveXP` to check instance status before applying XP modifications. - Updated `OnLogout` to clean up instance tracking data. ## How to Test 1. Enable the SoloCraft module. 2. Enter a dungeon or raid and kill some mobs. Verify that XP is modified as expected. 3. Exit the instance and kill mobs in the open world. Verify that XP is not modified. 4. Re-enter an instance and confirm that XP modification resumes. ## Issues Addressed This PR fixes the issue where XP modification was being applied globally, even outside of instances.
- Loading branch information