Skip to content

Commit cfd9cdf

Browse files
committed
Rename defines to correct names and minor clean up
1 parent c99f83f commit cfd9cdf

10 files changed

+49
-50
lines changed

LuaEngine.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -989,13 +989,13 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc
989989
void Eluna::UpdateEluna(uint32 diff)
990990
{
991991
if (reload && sElunaLoader->GetCacheState() == SCRIPT_CACHE_READY)
992-
#if defined ELUNA_TRINITY && ELUNA_EXPANSION == WOTLK
992+
#if defined ELUNA_TRINITY && ELUNA_EXPANSION != EXP_RETAIL
993993
if(!GetQueryProcessor().HasPendingCallbacks())
994994
#endif
995995
_ReloadEluna();
996996

997997
eventMgr->globalProcessor->Update(diff);
998-
#if defined ELUNA_TRINITY && ELUNA_EXPANSION == WOTLK
998+
#if defined ELUNA_TRINITY && ELUNA_EXPANSION != EXP_RETAIL
999999
GetQueryProcessor().ProcessReadyCallbacks();
10001000
#endif
10011001
}

hooks/ItemHooks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ bool Eluna::OnItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targ
103103

104104
bool Eluna::OnExpire(Player* pPlayer, ItemTemplate const* pProto)
105105
{
106-
#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= CATA
106+
#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= EXP_CATA
107107
START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_EXPIRE, pProto->BasicData->ID, false);
108108
#else
109109
START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_EXPIRE, pProto->ItemId, false);
110110
#endif
111111
HookPush(pPlayer);
112-
#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= CATA
112+
#if defined ELUNA_TRINITY && ELUNA_EXPANSION >= EXP_CATA
113113
HookPush(pProto->BasicData->ID);
114114
#else
115115
HookPush(pProto->ItemId);

methods/TrinityCore/BattleGroundMethods.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace LuaBattleGround
8282
*/
8383
int GetEndTime(Eluna* E, BattleGround* bg)
8484
{
85-
#if ELUNA_EXPANSION >= CATA
85+
#if ELUNA_EXPANSION >= EXP_CATA
8686
E->Push(bg->GetRemainingTime());
8787
#else
8888
E->Push(bg->GetEndTime());

methods/TrinityCore/GlobalMethods.h

+16-20
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace LuaGlobalFunctions
7373
/**
7474
* Returns emulator's supported expansion.
7575
*
76-
* Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, 3 for Cataclysm, 9 for Dragonflight.
76+
* Expansion is 0 for pre-TBC, 1 for TBC, 2 for WotLK, 3 for Cataclysm, 9 for Retail.
7777
*
7878
* @return int32 expansion
7979
*/
@@ -1830,7 +1830,7 @@ namespace LuaGlobalFunctions
18301830
uint32 incrtime = E->CHECKVAL<uint32>(4);
18311831
uint32 extendedcost = E->CHECKVAL<uint32>(5);
18321832

1833-
#if ELUNA_EXPANSION >= CATA
1833+
#if ELUNA_EXPANSION >= EXP_CATA
18341834
VendorItem vItem;
18351835
vItem.item = item;
18361836
vItem.maxcount = maxcount;
@@ -1863,7 +1863,7 @@ namespace LuaGlobalFunctions
18631863
if (!eObjectMgr->GetCreatureTemplate(entry))
18641864
return luaL_argerror(E->L, 1, "valid CreatureEntry expected");
18651865

1866-
#if ELUNA_EXPANSION >= CATA
1866+
#if ELUNA_EXPANSION >= EXP_CATA
18671867
eObjectMgr->RemoveVendorItem(entry, item, 1);
18681868
#else
18691869
eObjectMgr->RemoveVendorItem(entry, item);
@@ -1887,7 +1887,7 @@ namespace LuaGlobalFunctions
18871887

18881888
auto const itemlist = items->m_items;
18891889
for (auto itr = itemlist.begin(); itr != itemlist.end(); ++itr)
1890-
#if ELUNA_EXPANSION >= CATA
1890+
#if ELUNA_EXPANSION >= EXP_CATA
18911891
eObjectMgr->RemoveVendorItem(entry, itr->item, 1);
18921892
#else
18931893
eObjectMgr->RemoveVendorItem(entry, itr->item);
@@ -2295,7 +2295,6 @@ namespace LuaGlobalFunctions
22952295
return 1;
22962296
}
22972297
#endif
2298-
22992298
/**
23002299
* Returns `true` if Eluna is in compatibility mode, `false` if in multistate.
23012300
*
@@ -3161,33 +3160,33 @@ namespace LuaGlobalFunctions
31613160
{ "GetGuildByName", &LuaGlobalFunctions::GetGuildByName },
31623161
{ "GetGuildByLeaderGUID", &LuaGlobalFunctions::GetGuildByLeaderGUID },
31633162
{ "GetPlayerCount", &LuaGlobalFunctions::GetPlayerCount },
3164-
{ "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow },
3165-
{ "GetGUIDType", &LuaGlobalFunctions::GetGUIDType },
3166-
{ "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry },
31673163
#if ELUNA_EXPANSION < EXP_RETAIL
31683164
{ "GetPlayerGUID", &LuaGlobalFunctions::GetPlayerGUID },
31693165
{ "GetItemGUID", &LuaGlobalFunctions::GetItemGUID },
31703166
{ "GetObjectGUID", &LuaGlobalFunctions::GetObjectGUID },
31713167
{ "GetUnitGUID", &LuaGlobalFunctions::GetUnitGUID },
3168+
{ "GetGUIDLow", &LuaGlobalFunctions::GetGUIDLow },
3169+
{ "GetGUIDType", &LuaGlobalFunctions::GetGUIDType },
3170+
{ "GetGUIDEntry", &LuaGlobalFunctions::GetGUIDEntry },
31723171
{ "GetAreaName", &LuaGlobalFunctions::GetAreaName },
3172+
{ "GetItemLink", &LuaGlobalFunctions::GetItemLink },
31733173
#else
31743174
{ "GetPlayerGUID", METHOD_REG_NONE },
31753175
{ "GetItemGUID", METHOD_REG_NONE },
31763176
{ "GetObjectGUID", METHOD_REG_NONE },
31773177
{ "GetUnitGUID", METHOD_REG_NONE },
3178+
{ "GetGUIDLow", METHOD_REG_NONE },
3179+
{ "GetGUIDType", METHOD_REG_NONE },
3180+
{ "GetGUIDEntry", METHOD_REG_NONE },
31783181
{ "GetAreaName", METHOD_REG_NONE },
3182+
{ "GetItemLink", METHOD_REG_NONE },
31793183
#endif
31803184
{ "bit_not", &LuaGlobalFunctions::bit_not },
31813185
{ "bit_xor", &LuaGlobalFunctions::bit_xor },
31823186
{ "bit_rshift", &LuaGlobalFunctions::bit_rshift },
31833187
{ "bit_lshift", &LuaGlobalFunctions::bit_lshift },
31843188
{ "bit_or", &LuaGlobalFunctions::bit_or },
31853189
{ "bit_and", &LuaGlobalFunctions::bit_and },
3186-
#if ELUNA_EXPANSION < EXP_RETAIL
3187-
{ "GetItemLink", &LuaGlobalFunctions::GetItemLink },
3188-
#else
3189-
{ "GetItemLink", METHOD_REG_NONE },
3190-
#endif
31913190
{ "GetMapById", &LuaGlobalFunctions::GetMapById, METHOD_REG_WORLD }, // World state method only in multistate
31923191
{ "GetCurrTime", &LuaGlobalFunctions::GetCurrTime },
31933192
{ "GetTimeDiff", &LuaGlobalFunctions::GetTimeDiff },
@@ -3223,23 +3222,20 @@ namespace LuaGlobalFunctions
32233222
#if ELUNA_EXPANSION < EXP_RETAIL
32243223
{ "PerformIngameSpawn", &LuaGlobalFunctions::PerformIngameSpawn },
32253224
{ "CreatePacket", &LuaGlobalFunctions::CreatePacket },
3225+
{ "SendMail", &LuaGlobalFunctions::SendMail },
3226+
{ "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath },
32263227
#else
32273228
{ "PerformIngameSpawn", METHOD_REG_NONE },
32283229
{ "CreatePacket", METHOD_REG_NONE },
3230+
{ "SendMail", METHOD_REG_NONE },
3231+
{ "AddTaxiPath", METHOD_REG_NONE },
32293232
#endif
32303233
{ "AddVendorItem", &LuaGlobalFunctions::AddVendorItem },
32313234
{ "VendorRemoveItem", &LuaGlobalFunctions::VendorRemoveItem },
32323235
{ "VendorRemoveAllItems", &LuaGlobalFunctions::VendorRemoveAllItems },
32333236
{ "Kick", &LuaGlobalFunctions::Kick },
32343237
{ "Ban", &LuaGlobalFunctions::Ban },
32353238
{ "SaveAllPlayers", &LuaGlobalFunctions::SaveAllPlayers },
3236-
#if ELUNA_EXPANSION < EXP_RETAIL
3237-
{ "SendMail", &LuaGlobalFunctions::SendMail },
3238-
{ "AddTaxiPath", &LuaGlobalFunctions::AddTaxiPath },
3239-
#else
3240-
{ "SendMail", METHOD_REG_NONE },
3241-
{ "AddTaxiPath", METHOD_REG_NONE },
3242-
#endif
32433239
{ "CreateInt64", &LuaGlobalFunctions::CreateLongLong },
32443240
{ "CreateUint64", &LuaGlobalFunctions::CreateULongLong },
32453241
{ "StartGameEvent", &LuaGlobalFunctions::StartGameEvent },

methods/TrinityCore/GuildMethods.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ namespace LuaGuild
128128
return 1;
129129
}
130130

131-
#if ELUNA_EXPANSION < CATA
131+
#if ELUNA_EXPANSION < EXP_CATA
132132
/**
133133
* Sets the leader of this [Guild]
134134
*
@@ -293,7 +293,7 @@ namespace LuaGuild
293293
#if ELUNA_EXPANSION < CATA
294294
{ "SetLeader", &LuaGuild::SetLeader, METHOD_REG_WORLD }, // World state method only in multistate
295295
#else
296-
{ "SetLeader", METHOD_REG_NONE }, // World state method only in multistate
296+
{ "SetLeader", METHOD_REG_NONE },
297297
#endif
298298

299299
// Other

methods/TrinityCore/ItemMethods.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ namespace LuaItem
426426
*/
427427
int GetClass(Eluna* E, Item* item)
428428
{
429-
#if ELUNA_EXPANSION >= CATA
429+
#if ELUNA_EXPANSION >= EXP_CATA
430430
E->Push(item->GetTemplate()->GetClass());
431431
#else
432432
E->Push(item->GetTemplate()->Class);
@@ -441,7 +441,7 @@ namespace LuaItem
441441
*/
442442
int GetSubClass(Eluna* E, Item* item)
443443
{
444-
#if ELUNA_EXPANSION >= CATA
444+
#if ELUNA_EXPANSION >= EXP_CATA
445445
E->Push(item->GetTemplate()->GetSubClass());
446446
#else
447447
E->Push(item->GetTemplate()->SubClass);
@@ -471,7 +471,7 @@ namespace LuaItem
471471
*/
472472
int GetName(Eluna* E, Item* item)
473473
{
474-
#if ELUNA_EXPANSION >= CATA
474+
#if ELUNA_EXPANSION >= EXP_CATA
475475
E->Push(item->GetTemplate()->GetDefaultLocaleName());
476476
#else
477477
E->Push(item->GetTemplate()->Name1);
@@ -499,7 +499,7 @@ namespace LuaItem
499499
*/
500500
int GetQuality(Eluna* E, Item* item)
501501
{
502-
#if ELUNA_EXPANSION >= CATA
502+
#if ELUNA_EXPANSION >= EXP_CATA
503503
E->Push(item->GetTemplate()->GetQuality());
504504
#else
505505
E->Push(item->GetTemplate()->Quality);
@@ -549,7 +549,7 @@ namespace LuaItem
549549
*/
550550
int GetBuyCount(Eluna* E, Item* item)
551551
{
552-
#if ELUNA_EXPANSION >= CATA
552+
#if ELUNA_EXPANSION >= EXP_CATA
553553
E->Push(item->GetTemplate()->GetBuyCount());
554554
#else
555555
E->Push(item->GetTemplate()->BuyCount);
@@ -564,7 +564,7 @@ namespace LuaItem
564564
*/
565565
int GetBuyPrice(Eluna* E, Item* item)
566566
{
567-
#if ELUNA_EXPANSION >= CATA
567+
#if ELUNA_EXPANSION >= EXP_CATA
568568
E->Push(item->GetTemplate()->GetBuyPrice());
569569
#else
570570
E->Push(item->GetTemplate()->BuyPrice);
@@ -579,7 +579,7 @@ namespace LuaItem
579579
*/
580580
int GetSellPrice(Eluna* E, Item* item)
581581
{
582-
#if ELUNA_EXPANSION >= CATA
582+
#if ELUNA_EXPANSION >= EXP_CATA
583583
E->Push(item->GetTemplate()->GetSellPrice());
584584
#else
585585
E->Push(item->GetTemplate()->SellPrice);
@@ -594,7 +594,7 @@ namespace LuaItem
594594
*/
595595
int GetInventoryType(Eluna* E, Item* item)
596596
{
597-
#if ELUNA_EXPANSION >= CATA
597+
#if ELUNA_EXPANSION >= EXP_CATA
598598
E->Push(item->GetTemplate()->GetInventoryType());
599599
#else
600600
E->Push(item->GetTemplate()->InventoryType);
@@ -609,7 +609,7 @@ namespace LuaItem
609609
*/
610610
int GetAllowableClass(Eluna* E, Item* item)
611611
{
612-
#if ELUNA_EXPANSION >= CATA
612+
#if ELUNA_EXPANSION >= EXP_CATA
613613
E->Push(item->GetTemplate()->GetAllowableClass());
614614
#else
615615
E->Push(item->GetTemplate()->AllowableClass);
@@ -637,7 +637,7 @@ namespace LuaItem
637637
*/
638638
int GetItemLevel(Eluna* E, Item* item)
639639
{
640-
#if ELUNA_EXPANSION >= CATA
640+
#if ELUNA_EXPANSION >= EXP_CATA
641641
E->Push(item->GetTemplate()->GetBaseItemLevel());
642642
#else
643643
E->Push(item->GetTemplate()->ItemLevel);
@@ -704,7 +704,7 @@ namespace LuaItem
704704
*/
705705
int GetItemSet(Eluna* E, Item* item)
706706
{
707-
#if ELUNA_EXPANSION >= CATA
707+
#if ELUNA_EXPANSION >= EXP_CATA
708708
E->Push(item->GetTemplate()->GetItemSet());
709709
#else
710710
E->Push(item->GetTemplate()->ItemSet);

methods/TrinityCore/PlayerMethods.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ namespace LuaPlayer
19921992
return 0;
19931993
}
19941994

1995-
#if ELUNA_EXPANSION < CATA
1995+
#if ELUNA_EXPANSION < EXP_CATA
19961996
/**
19971997
* Sets the [Player]s Arena Points to the amount specified
19981998
*
@@ -2123,7 +2123,7 @@ namespace LuaPlayer
21232123
*
21242124
* @param int32 movementType
21252125
*/
2126-
#if ELUNA_EXPANSION < CATA
2126+
#if ELUNA_EXPANSION < EXP_CATA
21272127
int SetMovement(Eluna* E, Player* player)
21282128
{
21292129
int32 pType = E->CHECKVAL<int32>(2);
@@ -2182,7 +2182,7 @@ namespace LuaPlayer
21822182
return 0;
21832183
}
21842184

2185-
#if ELUNA_EXPANSION < CATA
2185+
#if ELUNA_EXPANSION < EXP_CATA
21862186
/**
21872187
* Adds or detracts from the [Player]s current Arena Points
21882188
*
@@ -2363,7 +2363,7 @@ namespace LuaPlayer
23632363
{
23642364
Creature* obj = E->CHECKOBJ<Creature>(2);
23652365

2366-
#if ELUNA_EXPANSION >= CATA
2366+
#if ELUNA_EXPANSION >= EXP_CATA
23672367
player->GetSession()->SendTrainerList(obj, NULL);
23682368
#else
23692369
player->GetSession()->SendTrainerList(obj);
@@ -2614,7 +2614,7 @@ namespace LuaPlayer
26142614
*/
26152615
int ResetTalentsCost(Eluna* E, Player* player)
26162616
{
2617-
#if ELUNA_EXPANSION >= CATA
2617+
#if ELUNA_EXPANSION >= EXP_CATA
26182618
E->Push(player->GetNextResetTalentsCost());
26192619
#else
26202620
E->Push(player->ResetTalentsCost());
@@ -3719,7 +3719,7 @@ namespace LuaPlayer
37193719
if (!quest)
37203720
return 0;
37213721

3722-
#if ELUNA_EXPANSION >= CATA
3722+
#if ELUNA_EXPANSION >= EXP_CATA
37233723
player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept, true);
37243724
#else
37253725
player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GET_GUID(), activateAccept);
@@ -4362,10 +4362,13 @@ namespace LuaPlayer
43624362
{ "GetHonorStoredKills", METHOD_REG_NONE }, // classic only
43634363
{ "GetRankPoints", METHOD_REG_NONE }, // classic only
43644364
{ "GetHonorLastWeekStandingPos", METHOD_REG_NONE }, // classic only
4365+
43654366
{ "SetHonorStoredKills", METHOD_REG_NONE }, // classic only
43664367
{ "SetRankPoints", METHOD_REG_NONE }, // classic only
43674368
{ "SetHonorLastWeekStandingPos", METHOD_REG_NONE }, // classic only
4369+
43684370
{ "CanFlyInZone", METHOD_REG_NONE }, // not implemented
4371+
43694372
{ "UpdateHonor", METHOD_REG_NONE }, // classic only
43704373
{ "ResetHonor", METHOD_REG_NONE }, // classic only
43714374
{ "ClearHonorInfo", METHOD_REG_NONE }, // classic only

methods/TrinityCore/QuestMethods.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ namespace LuaQuest
165165
*/
166166
int GetType(Eluna* E, Quest* quest)
167167
{
168-
#if ELUNA_EXPANSION >= CATA
168+
#if ELUNA_EXPANSION >= EXP_CATA
169169
E->Push(quest->GetQuestType());
170170
#else
171171
E->Push(quest->GetType());

methods/TrinityCore/VehicleMethods.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace LuaVehicle
6161
return 1;
6262
}
6363

64-
#if ELUNA_EXPANSION < CATA
64+
#if ELUNA_EXPANSION < EXP_CATA
6565
/**
6666
* Adds [Unit] passenger to a specified seat in the [Vehicle]
6767
*
@@ -102,7 +102,7 @@ namespace LuaVehicle
102102
{ "IsOnBoard", &LuaVehicle::IsOnBoard },
103103

104104
// Other
105-
#if ELUNA_EXPANSION < CATA
105+
#if ELUNA_EXPANSION < EXP_CATA
106106
{ "AddPassenger", &LuaVehicle::AddPassenger },
107107
#else
108108
{ "AddPassenger", METHOD_REG_NONE },

methods/TrinityCore/WorldObjectMethods.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace LuaWorldObject
4343
*/
4444
int GetPhaseMask(Eluna* E, WorldObject* obj)
4545
{
46-
#if ELUNA_EXPANSION >= CATA
46+
#if ELUNA_EXPANSION >= EXP_CATA
4747
EventMap event;
4848
E->Push(event.GetPhaseMask());
4949
#else
@@ -62,7 +62,7 @@ namespace LuaWorldObject
6262
{
6363
uint32 phaseMask = E->CHECKVAL<uint32>(2);
6464

65-
#if ELUNA_EXPANSION >= CATA
65+
#if ELUNA_EXPANSION >= EXP_CATA
6666
EventMap event;
6767
event.SetPhase(phaseMask);
6868
#else
@@ -1050,7 +1050,7 @@ namespace LuaWorldObject
10501050
#if ELUNA_EXPANSION == EXP_RETAIL
10511051
if (!sSoundKitStore.LookupEntry(musicid))
10521052
#else
1053-
if (!sSoundEntriesStore.LookupEntry(musicid))
1053+
if (!sSoundEntriesStore.LookupEntry(musicid))
10541054
#endif
10551055
musicid = 0;
10561056
WorldPackets::Misc::PlayMusic playMusic(musicid);

0 commit comments

Comments
 (0)