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
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)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
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)
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
HookPush(spell->ID); // Pass spell object?
#else
HookPush(spell->Id); // Pass spell object?
Expand Down
2 changes: 1 addition & 1 deletion hooks/ServerHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger)
HookPush(pTrigger->ID);
#elif defined ELUNA_AZEROTHCORE
HookPush(pTrigger->entry);
#elif defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_CLASSIC
#elif defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_CLASSIC || ELUNA_EXPANSION == EXP_WOTLK)

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 Gate aligned DBC fields behind a feature macro

When building Eluna against the current/released MaNGOS WOTLK core rather than the separate DBC-alignment branch, this expansion-only condition sends all WOTLK builds to pTrigger->ID, but that core still exposes AreaTriggerEntry::id; the same pattern is applied to the other renamed DBC fields in this commit. This makes ordinary WOTLK builds fail unless the companion core changes are present, so the new layout should be guarded by a layout/feature macro instead of EXP_WOTLK alone.

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.

Intended — this is the established cross-fork DBC-alignment pattern in this repo,
not an oversight.

The aligned reads are gated on ELUNA_EXPANSION == EXP_WOTLK deliberately,
matching the already-merged CLASSIC (#2) and TBC (#4) arms on these same files,
which gate on EXP_CLASSIC / EXP_TBC rather than a separate feature macro. The
WOTLK arm just extends that same ladder.

The coupling to the renamed core layout is enforced by the companion PR, not left
to chance: mangos-two/server#239 renames the DBC fields and bumps this Eluna
submodule to this exact commit in the same change, so mangos-two always builds
aligned-core + WOTLK-Eluna-arms together. There is no released configuration where
one is present without the other — the "un-aligned WOTLK core + this Eluna" case
only arises if the submodule is hand-bumped past this PR without applying the core
change, which the pin prevents. Other cores are unaffected (EXP_WOTLK is false
for them).

A layout/feature macro would decouple it further, but it would diverge from the
CLASSIC/TBC arms already on master; keeping WOTLK consistent with them is the
intent here. Merging in lockstep with the core PR.

HookPush(pTrigger->ID);
#else
HookPush(pTrigger->id);
Expand Down
16 changes: 11 additions & 5 deletions methods/Mangos/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ namespace LuaGlobalFunctions
if (!areaEntry)
return luaL_argerror(E->L, 1, "valid Area or Zone ID expected");

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

// mandatory
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
entry.ContinentID = E->CHECKVAL<uint32>(start);
entry.LocX = E->CHECKVAL<float>(start + 1);
entry.LocY = E->CHECKVAL<float>(start + 2);
Expand All @@ -2099,7 +2099,7 @@ namespace LuaGlobalFunctions
entry.z = E->CHECKVAL<float>(start + 3);
#endif
// optional
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#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);
#else
Expand Down Expand Up @@ -2137,11 +2137,11 @@ namespace LuaGlobalFunctions
TaxiPathNodeEntry& entry = *it;
TaxiNodesEntry* nodeEntry = new TaxiNodesEntry();

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
entry.PathID = pathId;
entry.NodeIndex = nodeId;
nodeEntry->ID = index;
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
nodeEntry->ContinentID = entry.ContinentID;
#else
nodeEntry->map_id = entry.ContinentID;
Expand Down Expand Up @@ -2169,9 +2169,15 @@ namespace LuaGlobalFunctions

sTaxiPathSetBySource[startNode][nodeId - 1] = TaxiPathBySourceAndDestination(pathId, price);
TaxiPathEntry* pathEntry = new TaxiPathEntry();
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_WOTLK
pathEntry->FromTaxiNode = startNode;
pathEntry->ToTaxiNode = nodeId - 1;
pathEntry->Cost = price;
#else
pathEntry->from = startNode;
pathEntry->to = nodeId - 1;
pathEntry->price = price;
#endif
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC
pathEntry->Id = pathId;
#else
Expand Down
4 changes: 2 additions & 2 deletions methods/Mangos/ItemMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ namespace LuaItem
{
const ItemRandomSuffixEntry* itemRandEntry = sItemRandomSuffixStore.LookupEntry(-item->GetItemRandomPropertyId());
if (itemRandEntry)
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
suffix = itemRandEntry->Name_lang;
#else
suffix = itemRandEntry->nameSuffix;
Expand All @@ -281,7 +281,7 @@ namespace LuaItem
{
const ItemRandomPropertiesEntry* itemRandEntry = sItemRandomPropertiesStore.LookupEntry(item->GetItemRandomPropertyId());
if (itemRandEntry)
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC
#if defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK)
suffix = itemRandEntry->Name_lang;
#else
suffix = itemRandEntry->nameSuffix;
Expand Down
2 changes: 1 addition & 1 deletion methods/Mangos/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ namespace LuaPlayer
{
if (SkillLineEntry const* entry = sSkillLineStore.LookupEntry(i))
{
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
if (entry->CategoryID == SKILL_CATEGORY_LANGUAGES || entry->CategoryID == SKILL_CATEGORY_GENERIC)
continue;

Expand Down
2 changes: 1 addition & 1 deletion methods/Mangos/SpellMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace LuaSpell
*/
int GetEntry(Eluna* E, Spell* spell)
{
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(spell->m_spellInfo->ID);
#else
E->Push(spell->m_spellInfo->Id);
Expand Down
4 changes: 2 additions & 2 deletions methods/Mangos/UnitMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ namespace LuaUnit
if (!entry)
return 1;

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(entry->Name_lang[locale]);
#else
E->Push(entry->name[locale]);
Expand Down Expand Up @@ -987,7 +987,7 @@ namespace LuaUnit
if (!entry)
return 1;

#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_TBC)
#if ELUNA_EXPANSION == EXP_CLASSIC || (defined(ELUNA_MANGOS) && (ELUNA_EXPANSION == EXP_TBC || ELUNA_EXPANSION == EXP_WOTLK))
E->Push(entry->Name_lang[locale]);
#else
E->Push(entry->name[locale]);
Expand Down
4 changes: 4 additions & 0 deletions methods/Mangos/VehicleMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ namespace LuaVehicle
*/
int GetEntry(Eluna* E, Vehicle* vehicle)
{
#if defined(ELUNA_MANGOS) && ELUNA_EXPANSION == EXP_WOTLK
E->Push(vehicle->GetVehicleEntry()->ID);
#else
E->Push(vehicle->GetVehicleEntry()->m_ID);
#endif
return 1;
}

Expand Down
Loading