Fix: Disable giving Mastery on low tier gathering objects - #554
Conversation
WalkthroughThe update introduces a new data structure for mastery differential factors and integrates it into the mastery point awarding logic. It adds a conditional check in the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Maple2.Server.Game/Manager/MasteryManager.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: build
🔇 Additional comments (2)
Maple2.Server.Game/Manager/MasteryManager.cs (2)
140-153: LGTM! Well-implemented mastery gating logic.The conditional check effectively prevents mastery exploitation by blocking rewards when players are significantly overleveled. The logic correctly:
- Targets appropriate gathering mastery types (Farming, Mining, Gathering, Breeding)
- Uses a reasonable 3-level threshold to determine when content is too low-tier
- Returns early to skip mastery rewards while still allowing successful gathering
154-154: Correct placement of mastery increment.Moving the mastery increment after the conditional check ensures that mastery points are only awarded when the level gap check passes. This maintains the intended behavior while preserving the original flow for non-gated mastery types.
Summary by CodeRabbit
Bug Fixes
New Features