Got rid of cWorld::GetAllPlayers() and implemented ForEachPlayer() more or less in Lua
Core now uses ForEachPlayer() to interact with connected players git-svn-id: http://mc-server.googlecode.com/svn/trunk@260 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -989,26 +989,6 @@ bool cWorld::ForEachPlayer(cPlayerListCallback * a_Callback)
|
||||
|
||||
|
||||
|
||||
|
||||
void cWorld::GetAllPlayers( lua_State* L )
|
||||
{
|
||||
lua_createtable(L, m_Players.size(), 0);
|
||||
int newTable = lua_gettop(L);
|
||||
int index = 1;
|
||||
cPlayerList::const_iterator iter = m_Players.begin();
|
||||
while(iter != m_Players.end())
|
||||
{
|
||||
tolua_pushusertype( L, (*iter), "cPlayer" );
|
||||
lua_rawseti(L, newTable, index);
|
||||
++iter;
|
||||
++index;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: This interface is dangerous!
|
||||
cPlayer* cWorld::GetPlayer( const char* a_PlayerName )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user