From 437ab629969ece89d8add3ac74e1e67e491370fc Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 1 Nov 2021 08:31:37 -0300 Subject: [PATCH] fix(UnitMethods): GetFaction/SetFaction case update (#9) --- PlayerMethods.h | 6 ++---- UnitMethods.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/PlayerMethods.h b/PlayerMethods.h index d61e934..99d12e6 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1707,7 +1707,7 @@ namespace LuaPlayer { uint8 race = Eluna::CHECKVAL(L, 2); -#ifdef TRINITY +#if defined TRINITY || AZEROTHCORE player->SetFactionForRace(race); #else player->setFactionForRace(race); @@ -2268,10 +2268,8 @@ namespace LuaPlayer { Unit* unit = Eluna::CHECKOBJ(L, 2); -#ifdef TRINITY +#if defined TRINITY || AZEROTHCORE AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->GetFaction()); -#elif AZEROTHCORE - AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit->getFaction()); #else AuctionHouseEntry const* ahEntry = AuctionHouseMgr::GetAuctionHouseEntry(unit); #endif diff --git a/UnitMethods.h b/UnitMethods.h index 3ff3c2d..cc85a0a 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1221,7 +1221,7 @@ namespace LuaUnit */ int GetFaction(lua_State* L, Unit* unit) { -#ifdef TRINITY +#if defined TRINITY || AZEROTHCORE Eluna::Push(L, unit->GetFaction()); #else Eluna::Push(L, unit->getFaction()); @@ -1553,7 +1553,7 @@ namespace LuaUnit int SetFaction(lua_State* L, Unit* unit) { uint32 factionId = Eluna::CHECKVAL(L, 2); -#ifdef TRINITY +#if defined TRINITY || AZEROTHCORE unit->SetFaction(factionId); #else unit->setFaction(factionId);