From e7ea352f41b867dad83d170b7382b22a46f25c49 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 14 Feb 2012 19:14:23 +0000 Subject: 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 --- source/cWorld.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'source/cWorld.cpp') diff --git a/source/cWorld.cpp b/source/cWorld.cpp index c007070c6..737751901 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -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 ) { -- cgit v1.2.3