From 8697e932ae303bda270cc8f8abd048a90fafbe8d Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Thu, 18 Oct 2018 20:42:44 +0300 Subject: [PATCH] Fix mangos two build --- ElunaIncludes.h | 2 +- ElunaUtility.h | 2 +- GlobalMethods.h | 6 ++++-- GuildMethods.h | 6 ++++-- LuaEngine.cpp | 6 +++--- LuaEngine.h | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ElunaIncludes.h b/ElunaIncludes.h index e3ea622..b9e226e 100644 --- a/ElunaIncludes.h +++ b/ElunaIncludes.h @@ -144,7 +144,7 @@ typedef Opcodes OpcodesList; #define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT #define TEAM_NEUTRAL TEAM_INDEX_NEUTRAL -#if defined(TBC) || (defined(WOTLK) && !defined(MANGOS)) || defined(CATA) +#if defined(TBC) || defined(WOTLK) || defined(CATA) #define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS #endif diff --git a/ElunaUtility.h b/ElunaUtility.h index d278974..ad79e1c 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -63,7 +63,7 @@ typedef QueryNamedResult ElunaQuery; #define GetTemplate GetProto #endif -#ifdef TRINITY +#if defined(TRINITY) || defined(MANGOS) #ifndef MAKE_NEW_GUID #define MAKE_NEW_GUID(l, e, h) ObjectGuid(h, e, l) #endif diff --git a/GlobalMethods.h b/GlobalMethods.h index 3cc0c45..5c87a37 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -156,7 +156,7 @@ namespace LuaGlobalFunctions int tbl = lua_gettop(L); uint32 i = 0; -#ifdef MANGOS +#if defined(MANGOS) && defined(CLASSIC) eObjectAccessor()DoForAllPlayers([&](Player* player){ if(player->IsInWorld()) { @@ -171,8 +171,10 @@ namespace LuaGlobalFunctions { #ifdef TRINITY boost::shared_lock lock(*HashMapHolder::GetLock()); -#elif AZEROTHCORE +#elif defined(AZEROTHCORE) TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); +#elif defined(MANGOS) && !defined(CLASSIC) + ACE_READ_GUARD_RETURN(HashMapHolder::LockType, g, HashMapHolder::GetLock(), 0) #else HashMapHolder::ReadGuard g(HashMapHolder::GetLock()); #endif diff --git a/GuildMethods.h b/GuildMethods.h index 1e669e5..5953d7a 100644 --- a/GuildMethods.h +++ b/GuildMethods.h @@ -25,7 +25,7 @@ namespace LuaGuild int tbl = lua_gettop(L); uint32 i = 0; -#ifdef MANGOS +#if defined(MANGOS) && defined(CLASSIC) eObjectAccessor()DoForAllPlayers([&](Player* player) { if (player->IsInWorld() && player->GetGuildId() == guild->GetId()) @@ -38,8 +38,10 @@ namespace LuaGuild { #ifdef TRINITY boost::shared_lock lock(*HashMapHolder::GetLock()); -#elif AZEROTHCORE +#elif defined(AZEROTHCORE) TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); +#elif defined(MANGOS) && !defined(CLASSIC) + ACE_READ_GUARD_RETURN(HashMapHolder::LockType, g, HashMapHolder::GetLock(), 0) #else HashMapHolder::ReadGuard g(HashMapHolder::GetLock()); #endif diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 000d1ba..a36e121 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -519,10 +519,10 @@ void Eluna::RunScripts() void Eluna::InvalidateObjects() { ++callstackid; -#ifdef AZEROTHCORE - ASSERT(callstackid && "Callstackid overflow"); -#else +#ifdef TRINITY ASSERT(callstackid, "Callstackid overflow"); +#else + ASSERT(callstackid && "Callstackid overflow"); #endif } diff --git a/LuaEngine.h b/LuaEngine.h index db372f9..85f4ca6 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -13,7 +13,7 @@ #include "Group.h" #include "Item.h" -#if defined(TRINITY) || AZEROTHCORE +#ifndef TRINITY #include "Player.h" #endif #include "Weather.h"