diff options
author | andrew <xdotftw@gmail.com> | 2014-02-23 12:25:02 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-02-23 12:25:02 +0100 |
commit | 30b22e9f59e0873be84e80c83d274dbe5353b835 (patch) | |
tree | 7d4a1de7ac03ccb112340ca80905ae77cfbea77b /src | |
parent | Documented and exported cMapManager (diff) | |
download | cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar.gz cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar.bz2 cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar.lz cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar.xz cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.tar.zst cuberite-30b22e9f59e0873be84e80c83d274dbe5353b835.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Bindings/ManualBindings.cpp | 4 | ||||
-rw-r--r-- | src/Map.h | 5 | ||||
-rw-r--r-- | src/MapManager.cpp | 2 | ||||
-rw-r--r-- | src/MapManager.h | 2 |
4 files changed, 11 insertions, 2 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index c220e5e0a..f2d21a682 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2511,6 +2511,10 @@ void ManualBindings::Bind(lua_State * tolua_S) tolua_function(tolua_S, "UpdateSign", tolua_cWorld_SetSignLines); tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cMapManager"); + tolua_function(tolua_S, "DoWithMap", tolua_DoWithID<cMapManager, cMap, &cMapManager::DoWithMap>); + tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cPlugin"); tolua_function(tolua_S, "Call", tolua_cPlugin_Call); tolua_endmodule(tolua_S); @@ -185,6 +185,11 @@ public: const cColorList & GetData(void) const { return m_Data; } + static const char * GetClassStatic(void) // Needed for ManualBindings's DoWith templates + { + return "cMap"; + } + protected: diff --git a/src/MapManager.cpp b/src/MapManager.cpp index 2fc44ccc8..9d02eafb4 100644 --- a/src/MapManager.cpp +++ b/src/MapManager.cpp @@ -22,7 +22,7 @@ cMapManager::cMapManager(cWorld * a_World) -bool cMapManager::DoWithMap(unsigned int a_ID, cMapCallback & a_Callback) +bool cMapManager::DoWithMap(int a_ID, cMapCallback & a_Callback) { cCSLock Lock(m_CS); cMap * Map = GetMapData(a_ID); diff --git a/src/MapManager.h b/src/MapManager.h index 5da8be035..80e6d16d1 100644 --- a/src/MapManager.h +++ b/src/MapManager.h @@ -45,7 +45,7 @@ public: * Returns true if the map was found and the callback called, false if map not found. * Callback return ignored. */ - bool DoWithMap(unsigned int a_ID, cMapCallback & a_Callback); // tolua_export + bool DoWithMap(int a_ID, cMapCallback & a_Callback); // Exported in ManualBindings.cpp /** Calls the callback for each map. * |