Skip to content

MISTS: add EXP_MISTS expansion + guard arms for MoP (Four) DBC field renames - #6

Merged
MadMaxMangos merged 5 commits into
masterfrom
mists/dbc-align-guards
Jul 14, 2026
Merged

MISTS: add EXP_MISTS expansion + guard arms for MoP (Four) DBC field renames#6
MadMaxMangos merged 5 commits into
masterfrom
mists/dbc-align-guards

Conversation

@MadMaxMangos

@MadMaxMangos MadMaxMangos commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces the EXP_MISTS expansion 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 than EXP_CATA, ordered comparisons (>= EXP_CATA, < EXP_CATA, …) already classify it correctly, and the guard-arm insertions never modify a non-MISTS branch.

What changed

  1. ElunaUtility.h#define EXP_MISTS 4 (after EXP_CATA 3). This lets a mangos-MoP build define ELUNA_EXPANSION=4 instead of masquerading as EXP_CATA.
  2. CATA-era == EXP_CATA conditionals — the handful of equality checks in the mangos-compiled surface that gate "Cata-and-later" behavior were widened == EXP_CATA>= EXP_CATA so MoP keeps that behavior. This is additive: value 3 still matches, 4 newly matches, 0/1/2 still 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.)
  3. Guard arms for the DBC fields MoP renamed, each inserted before the existing #else (CATA) arm as #elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS (or MISTS added to an existing new-name #if group). Fields: AreaTable area_name→AreaName_lang; AreaTrigger id→ID (hooks/ServerHooks.cpp + hooks/CreatureHooks.cpp spell Id→ID); AuctionHouse houseId→ID; ChrClasses/ChrRaces name→Name_lang; ItemRandomProperties/ItemRandomSuffix nameSuffix→Name_lang; SkillLine categoryId→CategoryID,id→ID; Spell Id→ID; TaxiNodes map_id→ContinentID; TaxiPath from/to/price→FromTaxiNode/ToTaxiNode/Cost; TaxiPathNode mapid/actionFlag/delay/path/index→ContinentID/Flags/Delay/PathID/NodeIndex; Vehicle m_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_MANGOS gate is kept on every arm so non-mangos cores (which see ELUNA_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 in src/{game,mangosd,shared}/CMakeLists.txt). Without EXP_MISTS, such a build previously had to compile Eluna as EXP_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 Reviewable

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread hooks/ServerHooks.cpp
#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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ElunaUtility.h
#define EXP_TBC 1
#define EXP_WOTLK 2
#define EXP_CATA 3
#define EXP_MISTS 4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@MadMaxMangos
MadMaxMangos merged commit 37d964e into master Jul 14, 2026
12 of 24 checks passed
@MadMaxMangos
MadMaxMangos deleted the mists/dbc-align-guards branch July 14, 2026 13:52
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.

1 participant