summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-19 12:49:54 +0200
committerMattes D <github@xoft.cz>2014-10-19 12:49:54 +0200
commitd50bbf3899a1f28b23f98718e8acc76e294454a8 (patch)
tree75d5995178ec9e3fba41831631326d4c51fa0582
parentcLuaState: cBlockEntity descendants are pushed with proper class type. (diff)
downloadcuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar.gz
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar.bz2
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar.lz
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar.xz
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.tar.zst
cuberite-d50bbf3899a1f28b23f98718e8acc76e294454a8.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 49d643688..2c4d89b01 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -558,7 +558,16 @@ void cLuaState::Push(cEntity * a_Entity)
{
ASSERT(IsValid());
- tolua_pushusertype(m_LuaState, a_Entity, (a_Entity == nullptr) ? "cEntity" : a_Entity->GetClass());
+ if (a_Entity->IsMob())
+ {
+ // Don't push specific mob types, as those are not exported in the API:
+ tolua_pushusertype(m_LuaState, a_Entity, "cMonster");
+ }
+ else
+ {
+ // Push the specific class type:
+ tolua_pushusertype(m_LuaState, a_Entity, (a_Entity == nullptr) ? "cEntity" : a_Entity->GetClass());
+ }
m_NumCurrentFunctionArgs += 1;
}