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

Conversation

Hotschmoe
Copy link

@Hotschmoe Hotschmoe commented Aug 21, 2024

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.

closes #46
closes #42

…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.
@Helias Helias merged commit 2b8193e into azerothcore:master Aug 21, 2024
1 check passed
@Helias Helias mentioned this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: XP modifiers are global - players not in group affected also Bug: XP Rate Issue w/ Mob Kills
2 participants