From 7e41c418bcbfc10677ee8cef8821e750d894d339 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Thu, 4 Jul 2019 21:19:30 +0300 Subject: [PATCH] Fix TC build --- AuraMethods.h | 4 ++++ ItemMethods.h | 4 ++++ UnitMethods.h | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/AuraMethods.h b/AuraMethods.h index 0bf3449..2e6589f 100644 --- a/AuraMethods.h +++ b/AuraMethods.h @@ -54,7 +54,11 @@ namespace LuaAura */ int GetCasterLevel(lua_State* L, Aura* aura) { +#ifdef TRINITY + Eluna::Push(L, aura->GetCaster()->GetLevel()); +#else Eluna::Push(L, aura->GetCaster()->getLevel()); +#endif return 1; } diff --git a/ItemMethods.h b/ItemMethods.h index f610989..9838078 100644 --- a/ItemMethods.h +++ b/ItemMethods.h @@ -307,7 +307,11 @@ namespace LuaItem item->GetEnchantmentId(BONUS_ENCHANTMENT_SLOT) << ":" << #endif item->GetItemRandomPropertyId() << ":" << item->GetItemSuffixFactor() << ":" << +#ifdef TRINITY + (uint32)item->GetOwner()->GetLevel() << "|h[" << name << "]|h|r"; +#else (uint32)item->GetOwner()->getLevel() << "|h[" << name << "]|h|r"; +#endif Eluna::Push(L, oss.str()); return 1; diff --git a/UnitMethods.h b/UnitMethods.h index 5a6d4ca..a032902 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -836,7 +836,11 @@ namespace LuaUnit */ int GetLevel(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetLevel()); +#else Eluna::Push(L, unit->getLevel()); +#endif return 1; } @@ -1026,7 +1030,11 @@ namespace LuaUnit */ int GetGender(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetGender()); +#else Eluna::Push(L, unit->getGender()); +#endif return 1; } @@ -1037,7 +1045,11 @@ namespace LuaUnit */ int GetRace(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetRace()); +#else Eluna::Push(L, unit->getRace()); +#endif return 1; } @@ -1048,7 +1060,11 @@ namespace LuaUnit */ int GetClass(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetClass()); +#else Eluna::Push(L, unit->getClass()); +#endif return 1; } @@ -1059,7 +1075,11 @@ namespace LuaUnit */ int GetRaceMask(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetRaceMask()); +#else Eluna::Push(L, unit->getRaceMask()); +#endif return 1; } @@ -1070,7 +1090,11 @@ namespace LuaUnit */ int GetClassMask(lua_State* L, Unit* unit) { +#ifdef TRINITY + Eluna::Push(L, unit->GetClassMask()); +#else Eluna::Push(L, unit->getClassMask()); +#endif return 1; } @@ -1131,7 +1155,11 @@ namespace LuaUnit if (locale >= TOTAL_LOCALES) return luaL_argerror(L, 2, "valid LocaleConstant expected"); +#ifdef TRINITY + const ChrClassesEntry* entry = sChrClassesStore.LookupEntry(unit->GetClass()); +#else const ChrClassesEntry* entry = sChrClassesStore.LookupEntry(unit->getClass()); +#endif if (!entry) return 1; @@ -1166,7 +1194,11 @@ namespace LuaUnit if (locale >= TOTAL_LOCALES) return luaL_argerror(L, 2, "valid LocaleConstant expected"); +#ifdef TRINITY + const ChrRacesEntry* entry = sChrRacesStore.LookupEntry(unit->GetRace()); +#else const ChrRacesEntry* entry = sChrRacesStore.LookupEntry(unit->getRace()); +#endif if (!entry) return 1;