summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-03-19 16:24:32 +0100
committerMattes D <github@xoft.cz>2015-03-19 16:24:32 +0100
commit2fed8c3227962fc3c7acef2d49513af77c69fa5e (patch)
tree0125db7ac79d8d3b7f3c4a3cf56f62a94df3725b /src
parentMerge pull request #1819 from bibo38/bugfix1783 (diff)
downloadcuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar.gz
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar.bz2
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar.lz
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar.xz
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.tar.zst
cuberite-2fed8c3227962fc3c7acef2d49513af77c69fa5e.zip
Diffstat (limited to 'src')
-rw-r--r--src/Bindings/ManualBindings.cpp6
-rw-r--r--src/Map.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index e93b11eaa..035be55ae 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -638,11 +638,11 @@ static int tolua_DoWithID(lua_State* tolua_S)
private:
virtual bool Item(Ty2 * a_Item) override
{
- lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); // Push function to call
- tolua_pushusertype(LuaState, a_Item, Ty2::GetClassStatic()); // Push the item
+ lua_rawgeti(LuaState, LUA_REGISTRYINDEX, FuncRef); // Push function to call
+ tolua_pushusertype(LuaState, a_Item, a_Item->GetClass()); // Push the item
if (TableRef != LUA_REFNIL)
{
- lua_rawgeti(LuaState, LUA_REGISTRYINDEX, TableRef); // Push the optional callbackdata param
+ lua_rawgeti(LuaState, LUA_REGISTRYINDEX, TableRef); // Push the optional callbackdata param
}
int s = lua_pcall(LuaState, (TableRef == LUA_REFNIL ? 1 : 2), 1, 0);
diff --git a/src/Map.h b/src/Map.h
index fe324a5e7..3e775231a 100644
--- a/src/Map.h
+++ b/src/Map.h
@@ -189,6 +189,11 @@ public:
return "cMap";
}
+ const char * GetClass(void) // Needed for ManualBindings' DoWith templates
+ {
+ return "cMap";
+ }
+
protected: