Skip to content

Commit f34e898

Browse files
committed
Fix CMaNGOS defines in line with new scheme
1 parent e89b721 commit f34e898

15 files changed

+173
-173
lines changed

ElunaIncludes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
#include "Spells/SpellAuras.h"
9494
#include "Spells/SpellMgr.h"
9595
#include "Tools/Language.h"
96-
#include "AI/BaseAI/UnitAI.h"
9796
#include "Server/SQLStorages.h"
9897
#if ELUNA_EXPANSION > CLASSIC
9998
#include "Arena/ArenaTeam.h"
@@ -103,6 +102,8 @@
103102
#endif
104103
#if ELUNA_EXPANSION >= CATA
105104
#include "AI/BaseAI/AggressorAI.h"
105+
#else
106+
#include "AI/BaseAI/UnitAI.h"
106107
#endif
107108
#endif
108109

methods/CMangos/AuraMethods.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ namespace LuaAura
123123
{
124124
int32 duration = E->CHECKVAL<int32>(2);
125125
aura->GetHolder()->SetAuraDuration(duration);
126-
#if (defined(TBC) || defined(CLASSIC))
126+
#if ELUNA_EXPANSION < WOTLK
127127
aura->GetHolder()->UpdateAuraDuration();
128128
#else
129129
aura->GetHolder()->SendAuraUpdate(false);
@@ -143,7 +143,7 @@ namespace LuaAura
143143
{
144144
int32 duration = E->CHECKVAL<int32>(2);
145145
aura->GetHolder()->SetAuraMaxDuration(duration);
146-
#if (defined(TBC) || defined(CLASSIC))
146+
#if ELUNA_EXPANSION < WOTLK
147147
aura->GetHolder()->UpdateAuraDuration();
148148
#else
149149
aura->GetHolder()->SendAuraUpdate(false);
@@ -162,7 +162,7 @@ namespace LuaAura
162162
int SetStackAmount(Eluna* E, Aura* aura)
163163
{
164164
uint8 amount = E->CHECKVAL<uint8>(2);
165-
#ifndef CATA
165+
#if ELUNA_EXPANSION < CATA
166166
aura->GetHolder()->SetStackAmount(amount, aura->GetTarget());
167167
#else
168168
aura->GetHolder()->SetStackAmount(amount);

methods/CMangos/BattleGroundMethods.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ namespace LuaBattleGround
107107
*/
108108
int GetInstanceId(Eluna* E, BattleGround* bg)
109109
{
110-
#ifndef CATA
110+
#if ELUNA_EXPANSION < CATA
111111
E->Push(bg->GetInstanceId());
112112
#else
113113
E->Push(bg->GetInstanceID());

methods/CMangos/CreatureMethods.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace LuaCreature
2626
return 1;
2727
}
2828

29-
#ifndef CATA
29+
#if ELUNA_EXPANSION < CATA
3030
/**
3131
* Returns `true` if the [Creature] is set to not give reputation when killed,
3232
* and returns `false` otherwise.
@@ -66,7 +66,7 @@ namespace LuaCreature
6666
{
6767
bool mustBeDead = E->CHECKVAL<bool>(2, false);
6868

69-
#ifndef CATA
69+
#if ELUNA_EXPANSION < CATA
7070
E->Push(creature->IsTargetableForAttack(mustBeDead));
7171
#else
7272
E->Push(creature->isTargetableForAttack(mustBeDead));
@@ -715,7 +715,7 @@ namespace LuaCreature
715715
return 1;
716716
}
717717

718-
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
718+
#if ELUNA_EXPANSION < CATA
719719
/**
720720
* Returns the [Creature]'s shield block value.
721721
*
@@ -827,7 +827,7 @@ namespace LuaCreature
827827
return 0;
828828
}
829829

830-
#ifndef CATA
830+
#if ELUNA_EXPANSION < CATA
831831
/**
832832
* Sets whether the [Creature] gives reputation or not.
833833
*
@@ -1056,7 +1056,7 @@ namespace LuaCreature
10561056
uint32 entry = E->CHECKVAL<uint32>(2);
10571057
uint32 dataGuidLow = E->CHECKVAL<uint32>(3, 0);
10581058

1059-
#ifndef CATA
1059+
#if ELUNA_EXPANSION < CATA
10601060
creature->UpdateEntry(entry, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL);
10611061
#else
10621062
creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL);
@@ -1160,7 +1160,7 @@ namespace LuaCreature
11601160
SpellEntry const* spellEntry = GetSpellStore()->LookupEntry<SpellEntry>(spell);
11611161
creature->AddThreat(victim, threat, false, (SpellSchoolMask)schoolMask, spellEntry);
11621162

1163-
#ifdef CLASSIC
1163+
#if ELUNA_EXPANSION == CLASSIC
11641164
creature->AddThreat(victim, threat, false, spellEntry ? GetSchoolMask(spellEntry->School) : SPELL_SCHOOL_MASK_NONE, spellEntry);
11651165
#else
11661166
creature->AddThreat(victim, threat, false, spellEntry ? static_cast<SpellSchoolMask>(spellEntry->SchoolMask) : SPELL_SCHOOL_MASK_NONE, spellEntry);
@@ -1219,7 +1219,7 @@ namespace LuaCreature
12191219
{ "GetRank", &LuaCreature::GetRank },
12201220
{ "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow },
12211221
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
1222-
#ifndef CATA
1222+
#if ELUNA_EXPANSION < CATA
12231223
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
12241224
#else
12251225
{ "GetShieldBlockValue", METHOD_REG_NONE },
@@ -1240,7 +1240,7 @@ namespace LuaCreature
12401240
{ "SetWalk", &LuaCreature::SetWalk },
12411241
{ "SetHomePosition", &LuaCreature::SetHomePosition },
12421242
{ "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots },
1243-
#ifndef CATA
1243+
#if ELUNA_EXPANSION < CATA
12441244
{ "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain },
12451245
#else
12461246
{ "SetDisableReputationGain", METHOD_REG_NONE },
@@ -1268,7 +1268,7 @@ namespace LuaCreature
12681268
{ "HasQuest", &LuaCreature::HasQuest },
12691269
{ "HasSpellCooldown", &LuaCreature::HasSpellCooldown },
12701270
{ "CanFly", &LuaCreature::CanFly },
1271-
#ifndef CATA
1271+
#if ELUNA_EXPANSION < CATA
12721272
{ "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled },
12731273
#else
12741274
{ "IsReputationGainDisabled", METHOD_REG_NONE },

methods/CMangos/GlobalMethods.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ namespace LuaGlobalFunctions
7878
*/
7979
int GetCoreExpansion(Eluna* E)
8080
{
81-
#ifdef CLASSIC
81+
#if ELUNA_EXPANSION == CLASSIC
8282
E->Push(0);
83-
#elif defined(TBC)
83+
#elif ELUNA_EXPANSION == TBC
8484
E->Push(1);
85-
#elif defined(WOTLK)
85+
#elif ELUNA_EXPANSION == WOTLK
8686
E->Push(2);
87-
#elif defined(CATA)
87+
#elif ELUNA_EXPANSION == CATA
8888
E->Push(3);
8989
#endif
9090
return 1;
@@ -460,7 +460,7 @@ namespace LuaGlobalFunctions
460460
std::ostringstream oss;
461461
oss << "|c" << std::hex << ItemQualityColors[temp->Quality] << std::dec <<
462462
"|Hitem:" << entry << ":0:" <<
463-
#ifndef CLASSIC
463+
#if ELUNA_EXPANSION > CLASSIC
464464
"0:0:0:0:" <<
465465
#endif
466466
"0:0:0:0|h[" << name << "]|h|r";
@@ -1678,7 +1678,7 @@ namespace LuaGlobalFunctions
16781678
float o = E->CHECKVAL<float>(8);
16791679
bool save = E->CHECKVAL<bool>(9, false);
16801680
uint32 durorresptime = E->CHECKVAL<uint32>(10, 0);
1681-
#if (!defined(TBC) && !defined(CLASSIC))
1681+
#if ELUNA_EXPANSION >= WOTLK
16821682
uint32 phase = E->CHECKVAL<uint32>(11, PHASEMASK_NORMAL);
16831683
if (!phase)
16841684
{
@@ -1705,7 +1705,7 @@ namespace LuaGlobalFunctions
17051705
return 1;
17061706
}
17071707

1708-
#if (defined(TBC) || defined(CLASSIC))
1708+
#if ELUNA_EXPANSION <= TBC
17091709
CreatureCreatePos pos(map, x, y, z, o);
17101710
#else
17111711
CreatureCreatePos pos(map, x, y, z, o, phase);
@@ -1718,7 +1718,7 @@ namespace LuaGlobalFunctions
17181718
E->Push();
17191719
return 1;
17201720
}
1721-
#ifndef CATA
1721+
#if ELUNA_EXPANSION < CATA
17221722
if (!pCreature->Create(lowguid, lowguid, pos, cinfo))
17231723
#else
17241724
if (!pCreature->Create(lowguid, pos, cinfo))
@@ -1729,9 +1729,9 @@ namespace LuaGlobalFunctions
17291729
return 1;
17301730
}
17311731

1732-
#ifdef TBC
1732+
#if ELUNA_EXPANSION == TBC
17331733
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
1734-
#elif defined(CLASSIC)
1734+
#elif ELUNA_EXPANSION == CLASSIC
17351735
pCreature->SaveToDB(map->GetId());
17361736
#else
17371737
pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase);
@@ -1740,7 +1740,7 @@ namespace LuaGlobalFunctions
17401740
uint32 db_guid = pCreature->GetGUIDLow();
17411741

17421742
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
1743-
#ifndef CATA
1743+
#if ELUNA_EXPANSION < CATA
17441744
pCreature->LoadFromDB(db_guid, map, db_guid, 0);
17451745
#else
17461746
pCreature->LoadFromDB(db_guid, map);
@@ -1764,12 +1764,12 @@ namespace LuaGlobalFunctions
17641764

17651765
TemporarySpawn* pCreature = new TemporarySpawn(ObjectGuid(uint64(0)));
17661766

1767-
#if (defined(TBC) || defined(CLASSIC))
1767+
#if ELUNA_EXPANSION <= TBC
17681768
CreatureCreatePos pos(map, x, y, z, o);
17691769
#else
17701770
CreatureCreatePos pos(map, x, y, z, o, phase);
17711771
#endif
1772-
#ifdef CATA
1772+
#if ELUNA_EXPANSION == CATA
17731773
if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
17741774
#else
17751775
if (!pCreature->Create(map->GenerateLocalLowGuid(cinfo->GetHighGuid()), map->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
@@ -1820,9 +1820,9 @@ namespace LuaGlobalFunctions
18201820
}
18211821

18221822
GameObject* pGameObj = new GameObject;
1823-
#if (defined(TBC) || defined(CLASSIC))
1823+
#if ELUNA_EXPANSION <= TBC
18241824
if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, x, y, z, o))
1825-
#elif defined CATA
1825+
#elif ELUNA_EXPANSION == CATA
18261826
if (!pGameObj->Create(db_lowGUID, gInfo->id, map, phase, x, y, z, o))
18271827
#else
18281828
if (!pGameObj->Create(db_lowGUID, db_lowGUID, gInfo->id, map, phase, x, y, z, o))
@@ -1837,16 +1837,16 @@ namespace LuaGlobalFunctions
18371837
pGameObj->SetRespawnTime(durorresptime);
18381838

18391839
// fill the gameobject data and save to the db
1840-
#ifdef TBC
1840+
#if ELUNA_EXPANSION == TBC
18411841
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()));
1842-
#elif defined(CLASSIC)
1842+
#elif ELUNA_EXPANSION == CLASSIC
18431843
pGameObj->SaveToDB(map->GetId());
18441844
#else
18451845
pGameObj->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), phase);
18461846
#endif
18471847

18481848
// this will generate a new guid if the object is in an instance
1849-
#ifndef CATA
1849+
#if ELUNA_EXPANSION < CATA
18501850
if (!pGameObj->LoadFromDB(db_lowGUID, map, db_lowGUID, 0))
18511851
#else
18521852
if (!pGameObj->LoadFromDB(db_lowGUID, map))
@@ -1869,9 +1869,9 @@ namespace LuaGlobalFunctions
18691869
else
18701870
{
18711871
GameObject* pGameObj = new GameObject;
1872-
#if (defined(TBC) || defined(CLASSIC))
1872+
#if ELUNA_EXPANSION <= TBC
18731873
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, x, y, z, o))
1874-
#elif !defined CATA
1874+
#elif ELUNA_EXPANSION == WOTLK
18751875
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o))
18761876
#else
18771877
if (!pGameObj->Create(map->GenerateLocalLowGuid(HIGHGUID_GAMEOBJECT), entry, map, phase, x, y, z, o))
@@ -1910,7 +1910,7 @@ namespace LuaGlobalFunctions
19101910
if (opcode >= NUM_MSG_TYPES)
19111911
return luaL_argerror(E->L, 1, "valid opcode expected");
19121912

1913-
#ifdef CLASSIC
1913+
#if ELUNA_EXPANSION == CLASSIC
19141914
E->Push(new WorldPacket((Opcodes)opcode, size));
19151915
#else
19161916
E->Push(new WorldPacket((OpcodesList)opcode, size));
@@ -1935,15 +1935,15 @@ namespace LuaGlobalFunctions
19351935
uint32 incrtime = E->CHECKVAL<uint32>(4);
19361936
uint32 extendedcost = E->CHECKVAL<uint32>(5);
19371937

1938-
#ifndef CATA
1938+
#if ELUNA_EXPANSION < CATA
19391939
if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0))
19401940
#else
19411941
if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost, 0))
19421942
#endif
19431943
return 0;
1944-
#ifdef CATA
1944+
#if ELUNA_EXPANSION == CATA
19451945
eObjectMgr->AddVendorItem(entry, item, VENDOR_ITEM_TYPE_ITEM, maxcount, incrtime, extendedcost);
1946-
#elif !defined CLASSIC
1946+
#elif ELUNA_EXPANSION > CLASSIC
19471947
eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost);
19481948
#else
19491949
eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime);
@@ -1964,7 +1964,7 @@ namespace LuaGlobalFunctions
19641964
if (!eObjectMgr->GetCreatureTemplate(entry))
19651965
return luaL_argerror(E->L, 1, "valid CreatureEntry expected");
19661966

1967-
#if defined(CATA)
1967+
#if ELUNA_EXPANSION == CATA
19681968
eObjectMgr->RemoveVendorItem(entry, item, 1);
19691969
#else
19701970
eObjectMgr->RemoveVendorItem(entry, item);
@@ -1987,7 +1987,7 @@ namespace LuaGlobalFunctions
19871987

19881988
auto const itemlist = items->m_items;
19891989
for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr)
1990-
#if defined(CATA)
1990+
#if ELUNA_EXPANSION == CATA
19911991
eObjectMgr->RemoveVendorItem(entry, (*itr)->item, 1);
19921992
#else
19931993
eObjectMgr->RemoveVendorItem(entry, (*itr)->item);
@@ -2370,7 +2370,7 @@ namespace LuaGlobalFunctions
23702370

23712371
sTaxiNodesStore.InsertEntry(nodeEntry, nodeId++);
23722372

2373-
#ifdef CATA
2373+
#if ELUNA_EXPANSION == CATA
23742374
sTaxiPathNodesByPath[pathId][index++] = new TaxiPathNodeEntry(entry);
23752375
#else
23762376
sTaxiPathNodesByPath[pathId].set(index++, new TaxiPathNodeEntry(entry));

methods/CMangos/GroupMethods.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace LuaGroup
3636
return 1;
3737
}
3838

39-
#if !(defined(CLASSIC) || defined(TBC))
39+
#if ELUNA_EXPANSION >= WOTLK
4040
/**
4141
* Returns 'true' if the [Group] is a LFG group
4242
*
@@ -200,7 +200,7 @@ namespace LuaGroup
200200
*/
201201
int GetGUID(Eluna* E, Group* group)
202202
{
203-
#ifdef CLASSIC
203+
#if ELUNA_EXPANSION == CLASSIC
204204
E->Push(group->GetId());
205205
#else
206206
E->Push(group->GET_GUID());
@@ -361,7 +361,7 @@ namespace LuaGroup
361361
if (icon >= TARGETICONCOUNT)
362362
return luaL_argerror(E->L, 2, "valid target icon expected");
363363

364-
#if (defined(CLASSIC) || defined(TBC))
364+
#if ELUNA_EXPANSION <= TBC
365365
group->SetTargetIcon(icon, target);
366366
#else
367367
group->SetTargetIcon(icon, setter, target);
@@ -402,7 +402,7 @@ namespace LuaGroup
402402
{ "IsAssistant", &LuaGroup::IsAssistant },
403403
{ "SameSubGroup", &LuaGroup::SameSubGroup },
404404
{ "HasFreeSlotSubGroup", &LuaGroup::HasFreeSlotSubGroup },
405-
#if defined WOTLK
405+
#if ELUNA_EXPANSION == WOTLK
406406
{ "IsLFGGroup", &LuaGroup::IsLFGGroup },
407407
#else
408408
{ "IsLFGGroup", METHOD_REG_NONE },

methods/CMangos/GuildMethods.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace LuaGuild
121121
return 1;
122122
}
123123

124-
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
124+
#if ELUNA_EXPANSION <= WOTLK
125125
/**
126126
* Sets the leader of this [Guild]
127127
*
@@ -136,7 +136,7 @@ namespace LuaGuild
136136
}
137137
#endif
138138

139-
#ifndef CLASSIC
139+
#if ELUNA_EXPANSION >= TBC
140140
/**
141141
* Sets the information of the bank tab specified
142142
*
@@ -252,13 +252,13 @@ namespace LuaGuild
252252
{ "GetMemberCount", &LuaGuild::GetMemberCount },
253253

254254
// Setters
255-
#if defined(TBC) || defined(WOTLK)
255+
#if ELUNA_EXPANSION >= TBC
256256
{ "SetBankTabText", &LuaGuild::SetBankTabText, METHOD_REG_WORLD }, // World state method only in multistate
257257
#else
258258
{ "SetBankTabText", METHOD_REG_NONE },
259259
#endif
260260
{ "SetMemberRank", &LuaGuild::SetMemberRank, METHOD_REG_WORLD }, // World state method only in multistate
261-
#ifndef CATA
261+
#if ELUNA_EXPANSION < CATA
262262
{ "SetLeader", &LuaGuild::SetLeader, METHOD_REG_WORLD }, // World state method only in multistate
263263
#else
264264
{ "SetLeader", METHOD_REG_NONE },

0 commit comments

Comments
 (0)