Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ElunaUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#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.)


#if !defined ELUNA_CMANGOS
#include "SharedDefines.h"
Expand Down
4 changes: 2 additions & 2 deletions hooks/CreatureHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ bool Eluna::SpellHit(Creature* me, WorldObject* caster, SpellInfo const* spell)
START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_HIT_BY_SPELL, me, false);
HookPush(me);
HookPush(caster);
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK || ELUNA_EXPANSION == EXP_MISTS)
HookPush(spell->ID); // Pass spell object?
#else
HookPush(spell->Id); // Pass spell object?
Expand All @@ -299,7 +299,7 @@ bool Eluna::SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* s
START_HOOK_WITH_RETVAL(CREATURE_EVENT_ON_SPELL_HIT_TARGET, me, false);
HookPush(me);
HookPush(target);
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK || ELUNA_EXPANSION == EXP_MISTS)
HookPush(spell->ID); // Pass spell object?
#else
HookPush(spell->Id); // Pass spell object?
Expand Down
2 changes: 2 additions & 0 deletions hooks/ServerHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger)
HookPush(pTrigger->entry);
#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.

#else
HookPush(pTrigger->id);
#endif
Expand Down
2 changes: 1 addition & 1 deletion methods/Mangos/BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace LuaBattleGround
*/
int GetEndTime(Eluna* E, BattleGround* bg)
{
#ifdef CATA
#if defined(CATA) || defined(MISTS)
E->Push(bg->GetRemainingTime());
#else
E->Push(bg->GetEndTime());
Expand Down
2 changes: 1 addition & 1 deletion methods/Mangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ namespace LuaCreature
*/
int GetShieldBlockValue(Eluna* E, Creature* creature)
{
#if ELUNA_EXPANSION == EXP_CATA
#if ELUNA_EXPANSION >= EXP_CATA
E->Push(creature->GetShieldBlockDamageValue());
#else
E->Push(creature->GetShieldBlockValue());
Expand Down
24 changes: 23 additions & 1 deletion methods/Mangos/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ namespace LuaGlobalFunctions

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(areaEntry->AreaName_lang[locale]);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
E->Push(areaEntry->AreaName_lang[locale]);
#else
E->Push(areaEntry->area_name[locale]);
#endif
Expand Down Expand Up @@ -1752,7 +1754,7 @@ namespace LuaGlobalFunctions

auto const itemlist = items->m_items;
for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr)
#if ELUNA_EXPANSION == EXP_CATA
#if ELUNA_EXPANSION >= EXP_CATA
eObjectMgr->RemoveVendorItem(entry, (*itr)->item, (*itr)->type);
#else
eObjectMgr->RemoveVendorItem(entry, (*itr)->item);
Expand Down Expand Up @@ -2092,6 +2094,11 @@ namespace LuaGlobalFunctions
entry.LocX = E->CHECKVAL<float>(start + 1);
entry.LocY = E->CHECKVAL<float>(start + 2);
entry.LocZ = E->CHECKVAL<float>(start + 3);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
entry.ContinentID = E->CHECKVAL<uint32>(start);
entry.x = E->CHECKVAL<float>(start + 1);
entry.y = E->CHECKVAL<float>(start + 2);
entry.z = E->CHECKVAL<float>(start + 3);
#else
entry.mapid = E->CHECKVAL<uint32>(start);
entry.x = E->CHECKVAL<float>(start + 1);
Expand All @@ -2102,6 +2109,9 @@ namespace LuaGlobalFunctions
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
entry.Flags = E->CHECKVAL<uint32>(start + 4, 0);
entry.Delay = E->CHECKVAL<uint32>(start + 5, 0);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
entry.Flags = E->CHECKVAL<uint32>(start + 4, 0);
entry.Delay = E->CHECKVAL<uint32>(start + 5, 0);
#else
entry.actionFlag = E->CHECKVAL<uint32>(start + 4, 0);
entry.delay = E->CHECKVAL<uint32>(start + 5, 0);
Expand Down Expand Up @@ -2149,6 +2159,14 @@ namespace LuaGlobalFunctions
nodeEntry->x = entry.LocX;
nodeEntry->y = entry.LocY;
nodeEntry->z = entry.LocZ;
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
entry.PathID = pathId;
entry.NodeIndex = nodeId;
nodeEntry->ID = index;
nodeEntry->ContinentID = entry.ContinentID;
nodeEntry->x = entry.x;
nodeEntry->y = entry.y;
nodeEntry->z = entry.z;
#else
entry.path = pathId;
entry.index = nodeId;
Expand All @@ -2173,6 +2191,10 @@ namespace LuaGlobalFunctions
pathEntry->FromTaxiNode = startNode;
pathEntry->ToTaxiNode = nodeId - 1;
pathEntry->Cost = price;
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
pathEntry->FromTaxiNode = startNode;
pathEntry->ToTaxiNode = nodeId - 1;
pathEntry->Cost = price;
#else
pathEntry->from = startNode;
pathEntry->to = nodeId - 1;
Expand Down
4 changes: 4 additions & 0 deletions methods/Mangos/ItemMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ namespace LuaItem
if (itemRandEntry)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
suffix = itemRandEntry->Name_lang;
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
suffix = itemRandEntry->Name_lang;
#else
suffix = itemRandEntry->nameSuffix;
#endif
Expand All @@ -283,6 +285,8 @@ namespace LuaItem
if (itemRandEntry)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
suffix = itemRandEntry->Name_lang;
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
suffix = itemRandEntry->Name_lang;
#else
suffix = itemRandEntry->nameSuffix;
#endif
Expand Down
12 changes: 10 additions & 2 deletions methods/Mangos/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ namespace LuaPlayer
*/
int GetShieldBlockValue(Eluna* E, Player* player)
{
#if ELUNA_EXPANSION == EXP_CATA
#if ELUNA_EXPANSION >= EXP_CATA
E->Push(player->GetShieldBlockDamageValue());
#else
E->Push(player->GetShieldBlockValue());
Expand Down Expand Up @@ -2080,6 +2080,8 @@ namespace LuaPlayer
data << unit->GET_GUID();
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC
data << uint32(ahEntry->ID);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
data << uint32(ahEntry->ID);
#else
data << uint32(ahEntry->houseId);
#endif
Expand Down Expand Up @@ -2424,7 +2426,7 @@ namespace LuaPlayer
*/
int ResetTalentsCost(Eluna* E, Player* player)
{
#ifdef CATA
#if defined(CATA) || defined(MISTS)
E->Push(player->GetNextResetTalentsCost());
#else
E->Push(player->resetTalentsCost());
Expand Down Expand Up @@ -2986,6 +2988,12 @@ namespace LuaPlayer
if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC)
continue;

if (player->HasSkill(entry->ID))
player->UpdateSkill(entry->ID, step);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC)
continue;

if (player->HasSkill(entry->ID))
player->UpdateSkill(entry->ID, step);
#else
Expand Down
2 changes: 2 additions & 0 deletions methods/Mangos/SpellMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ namespace LuaSpell
{
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(spell->m_spellInfo->ID);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
E->Push(spell->m_spellInfo->ID);
#else
E->Push(spell->m_spellInfo->Id);
#endif
Expand Down
6 changes: 5 additions & 1 deletion methods/Mangos/UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,8 @@ namespace LuaUnit

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(entry->Name_lang[locale]);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
E->Push(entry->Name_lang[locale]);
#else
E->Push(entry->name[locale]);
#endif
Expand Down Expand Up @@ -989,6 +991,8 @@ namespace LuaUnit

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(entry->Name_lang[locale]);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
E->Push(entry->Name_lang[locale]);
#else
E->Push(entry->name[locale]);
#endif
Expand Down Expand Up @@ -2186,7 +2190,7 @@ namespace LuaUnit

for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
#if ELUNA_EXPANSION == EXP_CATA
#if ELUNA_EXPANSION >= EXP_CATA
SpellEffectEntry const* spellEffect = spellEntry->GetSpellEffect(SpellEffectIndex(i));
uint8 eff = spellEffect->Effect;
#else
Expand Down
2 changes: 2 additions & 0 deletions methods/Mangos/VehicleMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace LuaVehicle
{
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_WOTLK
E->Push(vehicle->GetVehicleEntry()->ID);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_MISTS
E->Push(vehicle->GetVehicleEntry()->ID);
#else
E->Push(vehicle->GetVehicleEntry()->m_ID);
#endif
Expand Down
Loading