MISTS: add EXP_MISTS expansion + guard arms for MoP (Four) DBC field renames - #6
Conversation
…(spell->ID) Additive: MISTS joins the CLASSIC/TBC/WOTLK new-name group; #else (CATA) unchanged.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea387b6458
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #elif defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_WOTLK) | ||
| HookPush(pTrigger->ID); | ||
| #elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS | ||
| HookPush(pTrigger->ID); |
There was a problem hiding this comment.
Keep MISTS on the existing MaNGOS DBC names
For a Mangos Four/EXP_MISTS build, this arm selects AreaTriggerEntry::ID, but the current Four DBC struct still exposes the member as id (and the same lower-case naming is used for related structs such as AreaTableEntry::area_name and AuctionHouseEntry::houseId in src/game/Server/DBCStructure.h). Because this branch is compiled only when the new expansion value is used, the MoP target fails to compile unless the companion core has actually renamed those DBC fields; otherwise the MISTS arm should keep using the existing lower-case MaNGOS member names.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is the intended cross-repo coupling, not a mismatch. The companion Four core PR renames these DBC fields to their client-exact names — AreaTriggerEntry::id → ID, AreaTableEntry::area_name → AreaName_lang, AuctionHouseEntry::houseId → ID — so the EXP_MISTS arms here (pTrigger->ID, …) resolve against the renamed core. The three PRs land as one bundle (SD3 + Eluna first, then the core re-points its submodule pins), and Eluna already compiles+links against the renamed core in that configuration. Keeping the legacy lower-case names in the MISTS arm would instead break the MoP build.
| #define EXP_TBC 1 | ||
| #define EXP_WOTLK 2 | ||
| #define EXP_CATA 3 | ||
| #define EXP_MISTS 4 |
There was a problem hiding this comment.
Handle MISTS in the remaining CATA-only guards
Defining a distinct EXP_MISTS value means a MoP build no longer compiles as EXP_CATA, but several Mangos code paths still select Cata APIs only via #ifdef CATA; for example methods/Mangos/PlayerMethods.h still falls through to player->resetTalentsCost() instead of the Cata/MoP GetNextResetTalentsCost() path when only MISTS is defined. Those remaining CATA-only guards need the same MISTS coverage as the widened ELUNA_EXPANSION >= EXP_CATA checks, otherwise the new expansion target continues to compile against pre-Cata APIs.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed. A MoP build defines MISTS (via MANGOS_EXP), never CATA, so the two remaining #ifdef CATA API guards fell through to the pre-Cata #else: ResetTalentsCost (PlayerMethods.h) and GetEndTime (BattleGroundMethods.h). Widened both to #if defined(CATA) || defined(MISTS) in 32740c7. Both Cata+ APIs (GetNextResetTalentsCost, GetRemainingTime) exist in the Four core, and an incremental build confirms the MISTS arms compile+link. A full sweep of the compiled Eluna surface found these were the only two such sites. (Pre-existing gap — MANGOS_EXP=MISTS predates this branch — but the fix belongs here.)
ResetTalentsCost and GetEndTime gated their Cata+ API on `#ifdef CATA`, but a MoP (Four) build defines MISTS, not CATA, so both fell through to the pre-Cata `#else` and returned wrong values on MoP (resetTalentsCost vs GetNextResetTalentsCost; GetEndTime vs GetRemainingTime). Widen both to `#if defined(CATA) || defined(MISTS)`. Purely additive: no other fork's branch selection changes. Both Cata+ APIs exist in the Four core, so the MISTS arm compiles. Addresses Codex review (ElunaUtility.h:16 thread) on PR #6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Introduces the
EXP_MISTSexpansion to Eluna and adds MISTS guard arms so the Four (MoP 5.4.8) server can compile Eluna as a distinct expansion and align its core DBC struct fields to the build-exact client names. Purely additive for every other fork: the new expansion value is strictly greater thanEXP_CATA, ordered comparisons (>= EXP_CATA,< EXP_CATA, …) already classify it correctly, and the guard-arm insertions never modify a non-MISTS branch.What changed
ElunaUtility.h—#define EXP_MISTS 4(afterEXP_CATA 3). This lets a mangos-MoP build defineELUNA_EXPANSION=4instead of masquerading asEXP_CATA.== EXP_CATAconditionals — the handful of equality checks in the mangos-compiled surface that gate "Cata-and-later" behavior were widened== EXP_CATA→>= EXP_CATAso MoP keeps that behavior. This is additive: value3still matches,4newly matches,0/1/2still don't — no other fork is affected. (CMangos-only equality sites were left as-is; they don't compile for mangos and aren't MoP's to change.)#else(CATA) arm as#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS(or MISTS added to an existing new-name#ifgroup). Fields: AreaTablearea_name→AreaName_lang; AreaTriggerid→ID(hooks/ServerHooks.cpp+hooks/CreatureHooks.cppspellId→ID); AuctionHousehouseId→ID; ChrClasses/ChrRacesname→Name_lang; ItemRandomProperties/ItemRandomSuffixnameSuffix→Name_lang; SkillLinecategoryId→CategoryID,id→ID; SpellId→ID; TaxiNodesmap_id→ContinentID; TaxiPathfrom/to/price→FromTaxiNode/ToTaxiNode/Cost; TaxiPathNodemapid/actionFlag/delay/path/index→ContinentID/Flags/Delay/PathID/NodeIndex; Vehiclem_ID→ID.Cross-fork safety
Every non-MISTS branch is byte-identical to base (raw autocrlf-off diff audited; CRLF preserved, no whole-file line-ending churn). The
ELUNA_MANGOSgate is kept on every arm so non-mangos cores (which seeELUNA_EXPANSION==0) never take a MoP path. Verified by an adversarial cross-fork review.Prerequisite note for the mangos build
A mangos-MoP core must define
ELUNA_EXPANSION=4(the Four core PR does this insrc/{game,mangosd,shared}/CMakeLists.txt). WithoutEXP_MISTS, such a build previously had to compile Eluna asEXP_CATA=3.Land order
Companion to the Four core PR and the SD3 MISTS PR. Merge this + SD3 first, then the core PR re-points its submodule pointers to the merged masters. Base pin: current Eluna master (
18ff8fb8).This change is