mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
MaNGOS changes
This commit is contained in:
@@ -156,15 +156,23 @@ namespace LuaGlobalFunctions
|
||||
int tbl = lua_gettop(L);
|
||||
uint32 i = 0;
|
||||
|
||||
#ifdef MANGOS
|
||||
eObjectAccessor()DoForAllPlayers([&](Player* player){
|
||||
if(player->IsInWorld())
|
||||
{
|
||||
if ((team == TEAM_NEUTRAL || player->GetTeamId() == team) && (!onlyGM || player->isGameMaster()))
|
||||
{
|
||||
Eluna::Push(L, player);
|
||||
lua_rawseti(L, tbl, ++i);
|
||||
}
|
||||
}
|
||||
});
|
||||
#else
|
||||
{
|
||||
#ifdef TRINITY
|
||||
boost::shared_lock<boost::shared_mutex> lock(*HashMapHolder<Player>::GetLock());
|
||||
#else
|
||||
#ifdef MANGOS
|
||||
ACE_READ_GUARD_RETURN(HashMapHolder<Player>::LockType, g, HashMapHolder<Player>::GetLock(), 0)
|
||||
#else
|
||||
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
|
||||
#endif
|
||||
#endif
|
||||
const HashMapHolder<Player>::MapType& m = eObjectAccessor()GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator it = m.begin(); it != m.end(); ++it)
|
||||
@@ -185,7 +193,7 @@ namespace LuaGlobalFunctions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
lua_settop(L, tbl); // push table to top of stack
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user