Skip to content

Commit

Permalink
Fix define renames
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Aug 29, 2024
1 parent e5f206b commit bf7bd32
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion LuaFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ElunaConstrainedObjectRef<Object> GetWeakPtrForObjectImpl(Object const* obj)
}
ElunaConstrainedObjectRef<Quest> GetWeakPtrFor(Quest const* obj) { return { obj->GetWeakPtr(), nullptr }; }
ElunaConstrainedObjectRef<Spell> GetWeakPtrFor(Spell const* obj) { return { obj->GetWeakPtr(), obj->GetCaster()->GetMap() }; }
#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
ElunaConstrainedObjectRef<Vehicle> GetWeakPtrFor(Vehicle const* obj)
{
#if defined ELUNA_TRINITY
Expand Down
22 changes: 11 additions & 11 deletions hooks/GossipHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace Hooks;
bool Eluna::OnGossipHello(Player* pPlayer, GameObject* pGameObject)
{
START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_HELLO, pGameObject->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -39,7 +39,7 @@ bool Eluna::OnGossipHello(Player* pPlayer, GameObject* pGameObject)
bool Eluna::OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action)
{
START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_SELECT, pGameObject->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -54,7 +54,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 send
bool Eluna::OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action, const char* code)
{
START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_SELECT, pGameObject->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -70,7 +70,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32
void Eluna::HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code)
{
START_HOOK(PlayerGossipBindings, GOSSIP_EVENT_ON_SELECT, menuId);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -91,7 +91,7 @@ void Eluna::HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 send
bool Eluna::OnItemGossip(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/)
{
START_HOOK_WITH_RETVAL(ItemGossipBindings, GOSSIP_EVENT_ON_HELLO, pItem->GetEntry(), true);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -104,7 +104,7 @@ bool Eluna::OnItemGossip(Player* pPlayer, Item* pItem, SpellCastTargets const& /
void Eluna::HandleGossipSelectOption(Player* pPlayer, Item* pItem, uint32 sender, uint32 action, const std::string& code)
{
START_HOOK(ItemGossipBindings, GOSSIP_EVENT_ON_SELECT, pItem->GetEntry());
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -125,7 +125,7 @@ void Eluna::HandleGossipSelectOption(Player* pPlayer, Item* pItem, uint32 sender
bool Eluna::OnGossipHello(Player* pPlayer, Creature* pCreature)
{
START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_HELLO, pCreature->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
pPlayer->GetPlayerMenu()->ClearMenus();
#else
pPlayer->PlayerTalkClass->ClearMenus();
Expand All @@ -138,7 +138,7 @@ bool Eluna::OnGossipHello(Player* pPlayer, Creature* pCreature)
bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action)
{
START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_SELECT, pCreature->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
auto original_menu = *pPlayer->GetPlayerMenu();
pPlayer->GetPlayerMenu()->ClearMenus();
#else
Expand All @@ -151,7 +151,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender,
HookPush(action);
auto preventDefault = CallAllFunctionsBool(CreatureGossipBindings, key, true);
if (!preventDefault) {
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
*pPlayer->GetPlayerMenu() = original_menu;
#else
*pPlayer->PlayerTalkClass = original_menu;
Expand All @@ -163,7 +163,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender,
bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action, const char* code)
{
START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_SELECT, pCreature->GetEntry(), false);
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
auto original_menu = *pPlayer->GetPlayerMenu();
pPlayer->GetPlayerMenu()->ClearMenus();
#else
Expand All @@ -177,7 +177,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 send
HookPush(code);
auto preventDefault = CallAllFunctionsBool(CreatureGossipBindings, key, true);
if (!preventDefault) {
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA
#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < EXP_CATA
*pPlayer->GetPlayerMenu() = original_menu;
#else
*pPlayer->PlayerTalkClass = original_menu;
Expand Down
6 changes: 3 additions & 3 deletions methods/CMangos/AuraMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace LuaAura
{
int32 duration = E->CHECKVAL<int32>(2);
aura->GetHolder()->SetAuraDuration(duration);
#if ELUNA_EXPANSION < WOTLK
#if ELUNA_EXPANSION < EXP_WOTLK
aura->GetHolder()->UpdateAuraDuration();
#else
aura->GetHolder()->SendAuraUpdate(false);
Expand All @@ -143,7 +143,7 @@ namespace LuaAura
{
int32 duration = E->CHECKVAL<int32>(2);
aura->GetHolder()->SetAuraMaxDuration(duration);
#if ELUNA_EXPANSION < WOTLK
#if ELUNA_EXPANSION < EXP_WOTLK
aura->GetHolder()->UpdateAuraDuration();
#else
aura->GetHolder()->SendAuraUpdate(false);
Expand All @@ -162,7 +162,7 @@ namespace LuaAura
int SetStackAmount(Eluna* E, Aura* aura)
{
uint8 amount = E->CHECKVAL<uint8>(2);
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
aura->GetHolder()->SetStackAmount(amount, aura->GetTarget());
#else
aura->GetHolder()->SetStackAmount(amount);
Expand Down
2 changes: 1 addition & 1 deletion methods/CMangos/BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace LuaBattleGround
*/
int GetInstanceId(Eluna* E, BattleGround* bg)
{
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
E->Push(bg->GetInstanceId());
#else
E->Push(bg->GetInstanceID());
Expand Down
18 changes: 9 additions & 9 deletions methods/CMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace LuaCreature
return 1;
}

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
/**
* Returns `true` if the [Creature] is set to not give reputation when killed,
* and returns `false` otherwise.
Expand Down Expand Up @@ -66,7 +66,7 @@ namespace LuaCreature
{
bool mustBeDead = E->CHECKVAL<bool>(2, false);

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
E->Push(creature->IsTargetableForAttack(mustBeDead));
#else
E->Push(creature->isTargetableForAttack(mustBeDead));
Expand Down Expand Up @@ -715,7 +715,7 @@ namespace LuaCreature
return 1;
}

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
/**
* Returns the [Creature]'s shield block value.
*
Expand Down Expand Up @@ -827,7 +827,7 @@ namespace LuaCreature
return 0;
}

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
/**
* Sets whether the [Creature] gives reputation or not.
*
Expand Down Expand Up @@ -1056,7 +1056,7 @@ namespace LuaCreature
uint32 entry = E->CHECKVAL<uint32>(2);
uint32 dataGuidLow = E->CHECKVAL<uint32>(3, 0);

#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
creature->UpdateEntry(entry, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL);
#else
creature->UpdateEntry(entry, ALLIANCE, dataGuidLow ? eObjectMgr->GetCreatureData(dataGuidLow) : NULL);
Expand Down Expand Up @@ -1160,7 +1160,7 @@ namespace LuaCreature
SpellEntry const* spellEntry = GetSpellStore()->LookupEntry<SpellEntry>(spell);
creature->AddThreat(victim, threat, false, (SpellSchoolMask)schoolMask, spellEntry);

#if ELUNA_EXPANSION == CLASSIC
#if ELUNA_EXPANSION == EXP_CLASSIC
creature->AddThreat(victim, threat, false, spellEntry ? GetSchoolMask(spellEntry->School) : SPELL_SCHOOL_MASK_NONE, spellEntry);
#else
creature->AddThreat(victim, threat, false, spellEntry ? static_cast<SpellSchoolMask>(spellEntry->SchoolMask) : SPELL_SCHOOL_MASK_NONE, spellEntry);
Expand Down Expand Up @@ -1219,7 +1219,7 @@ namespace LuaCreature
{ "GetRank", &LuaCreature::GetRank },
{ "GetDBTableGUIDLow", &LuaCreature::GetDBTableGUIDLow },
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#else
{ "GetShieldBlockValue", METHOD_REG_NONE },
Expand All @@ -1240,7 +1240,7 @@ namespace LuaCreature
{ "SetWalk", &LuaCreature::SetWalk },
{ "SetHomePosition", &LuaCreature::SetHomePosition },
{ "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots },
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
{ "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain },
#else
{ "SetDisableReputationGain", METHOD_REG_NONE },
Expand Down Expand Up @@ -1268,7 +1268,7 @@ namespace LuaCreature
{ "HasQuest", &LuaCreature::HasQuest },
{ "HasSpellCooldown", &LuaCreature::HasSpellCooldown },
{ "CanFly", &LuaCreature::CanFly },
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
{ "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled },
#else
{ "IsReputationGainDisabled", METHOD_REG_NONE },
Expand Down
8 changes: 4 additions & 4 deletions methods/CMangos/GroupMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace LuaGroup
return 1;
}

#if ELUNA_EXPANSION >= WOTLK
#if ELUNA_EXPANSION >= EXP_WOTLK
/**
* Returns 'true' if the [Group] is a LFG group
*
Expand Down Expand Up @@ -200,7 +200,7 @@ namespace LuaGroup
*/
int GetGUID(Eluna* E, Group* group)
{
#if ELUNA_EXPANSION == CLASSIC
#if ELUNA_EXPANSION == EXP_CLASSIC
E->Push(group->GetId());
#else
E->Push(group->GET_GUID());
Expand Down Expand Up @@ -361,7 +361,7 @@ namespace LuaGroup
if (icon >= TARGETICONCOUNT)
return luaL_argerror(E->L, 2, "valid target icon expected");

#if ELUNA_EXPANSION <= TBC
#if ELUNA_EXPANSION <= EXP_TBC
group->SetTargetIcon(icon, target);
#else
group->SetTargetIcon(icon, setter, target);
Expand Down Expand Up @@ -402,7 +402,7 @@ namespace LuaGroup
{ "IsAssistant", &LuaGroup::IsAssistant },
{ "SameSubGroup", &LuaGroup::SameSubGroup },
{ "HasFreeSlotSubGroup", &LuaGroup::HasFreeSlotSubGroup },
#if ELUNA_EXPANSION == WOTLK
#if ELUNA_EXPANSION == EXP_WOTLK
{ "IsLFGGroup", &LuaGroup::IsLFGGroup },
#else
{ "IsLFGGroup", METHOD_REG_NONE },
Expand Down
8 changes: 4 additions & 4 deletions methods/CMangos/GuildMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace LuaGuild
return 1;
}

#if ELUNA_EXPANSION <= WOTLK
#if ELUNA_EXPANSION <= EXP_WOTLK
/**
* Sets the leader of this [Guild]
*
Expand All @@ -136,7 +136,7 @@ namespace LuaGuild
}
#endif

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Sets the information of the bank tab specified
*
Expand Down Expand Up @@ -252,13 +252,13 @@ namespace LuaGuild
{ "GetMemberCount", &LuaGuild::GetMemberCount },

// Setters
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
{ "SetBankTabText", &LuaGuild::SetBankTabText, METHOD_REG_WORLD }, // World state method only in multistate
#else
{ "SetBankTabText", METHOD_REG_NONE },
#endif
{ "SetMemberRank", &LuaGuild::SetMemberRank, METHOD_REG_WORLD }, // World state method only in multistate
#if ELUNA_EXPANSION < CATA
#if ELUNA_EXPANSION < EXP_CATA
{ "SetLeader", &LuaGuild::SetLeader, METHOD_REG_WORLD }, // World state method only in multistate
#else
{ "SetLeader", METHOD_REG_NONE },
Expand Down
10 changes: 5 additions & 5 deletions methods/CMangos/MapMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace LuaMap
{

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Returns `true` if the [Map] is an arena [BattleGround], `false` otherwise.
*
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace LuaMap
return 1;
}

#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
/**
* Returns `true` if the [Map] is a heroic, `false` otherwise.
*
Expand Down Expand Up @@ -111,7 +111,7 @@ namespace LuaMap
{
float x = E->CHECKVAL<float>(2);
float y = E->CHECKVAL<float>(3);
#if ELUNA_EXPANSION <= TBC
#if ELUNA_EXPANSION <= EXP_TBC
float z = map->GetHeight(x, y, MAX_HEIGHT);
#else
uint32 phasemask = E->CHECKVAL<uint32>(4, 1);
Expand All @@ -131,7 +131,7 @@ namespace LuaMap
*/
int GetDifficulty(Eluna* E, Map* map)
{
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
E->Push(map->GetDifficulty());
#else
E->Push((Difficulty)0);
Expand Down Expand Up @@ -353,7 +353,7 @@ namespace LuaMap
{ "IsDungeon", &LuaMap::IsDungeon },
{ "IsEmpty", &LuaMap::IsEmpty },
{ "IsRaid", &LuaMap::IsRaid },
#if ELUNA_EXPANSION >= TBC
#if ELUNA_EXPANSION >= EXP_TBC
{ "IsArena", &LuaMap::IsArena },
{ "IsHeroic", &LuaMap::IsHeroic },
#else
Expand Down
Loading

0 comments on commit bf7bd32

Please sign in to comment.