Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SoloCraft): Limit XP modification to instances only #49

Merged
merged 1 commit into from
Aug 21, 2024

Commits on Aug 21, 2024

  1. fix(SoloCraft): Limit XP modification to instances only * Add instanc…

    …e tracking for players * Modify XP only when player is in an instance * Fix build errors related to ObjectGuid usage
    
    ## 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.
    Hotschmoe committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    ec8fd04 View commit details
    Browse the repository at this point in the history