summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 85e3f9fc5..63170660b 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -16,6 +16,8 @@ extern "C"
#include "Bindings.h"
#include "ManualBindings.h"
#include "DeprecatedBindings.h"
+#include "../Entities/Entity.h"
+#include "../BlockEntities/BlockEntity.h"
// fwd: SQLite/lsqlite3.c
extern "C"
@@ -556,7 +558,7 @@ void cLuaState::Push(cEntity * a_Entity)
{
ASSERT(IsValid());
- tolua_pushusertype(m_LuaState, a_Entity, "cEntity");
+ tolua_pushusertype(m_LuaState, a_Entity, (a_Entity == nullptr) ? "cEntity" : a_Entity->GetClass());
m_NumCurrentFunctionArgs += 1;
}