[Decomp][Player] Extract SpellCooldownMgr and PetMgr from Player.cpp#424
Open
r-log wants to merge 1 commit into
Open
[Decomp][Player] Extract SpellCooldownMgr and PetMgr from Player.cpp#424r-log wants to merge 1 commit into
r-log wants to merge 1 commit into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 76 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the MangosTwo/MangosOne manager extractions to MangosZero (vanilla 1.12.x), mirroring mangostwo#234 and the mangosone managers PR. Lifts two cohesive concerns out of the
Playergod object into dedicated managers held by value onPlayer, withPlayerkeeping its full public API as inline delegators so no external call site changes.SpellCooldownMgr (
SpellCooldownMgr.{h,cpp}) — owns the spell-cooldown map + its load/save/apply lifecycle. TheSpellCooldownstruct +SpellCooldownstypedef move to the manager header.PetMgr (
PetMgr.{h,cpp}) — owns the stable-slot count and the temporary-unsummon pet number. The Pet creature itself and the stable opcode handlers are untouched; they route throughGetStableSlots()/SetStableSlots().Mechanics: new
XxxMgrwith aPlayer*back-pointer; state + logic moved in withPlayer::→XxxMgr::,this→m_owner, member reads renamed;Player.hgets the include + a by-value member + inline delegators keeping the original method names/signatures; state members and out-of-line bodies removed fromPlayer; ctor init-list gainsm_spellCooldownMgr(this)/m_petMgr(this)in member-declaration order; direct readers that stay behind are rewired (SendInitialSpells→GetSpellCooldownMap(), NPCHandler stable code →GetStableSlots()/SetStableSlots()).Vanilla bodies, not WotLK. Bodies are extracted from Zero's own
Player::code — e.g.PetMgr::UnsummonTemporaryIfAnykeeps Zero's transport-passenger removal block;SpellCooldownMgrkeeps the vanillacat == 76 || cat == 351ranged check and has no arena-cooldown method.HonorMgr intentionally NOT ported. Vanilla honor is the classic contribution-point ranking system (
m_honorCPlist +m_honor_rank/m_highest_rank+m_rank_points/m_stored_honor/stored kills +AddHonorCP/UpdateHonor/_LoadHonorCP/_SaveHonorCP) — a different domain from the honor-pointsHonorMgrthe siblings extracted (UpdateKills/Reward). Forcing that shape would be a redesign, not a port, so it is skipped (same expansion-delta category as Glyph/Rune managers being N/A here).Built green with MSVC 2022 (
gametarget), Eluna on and off.This change is