aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_base.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:15:45 +0200
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-05-13 18:15:45 +0200
commit5131675a60a73ebc2bb06e343e296950682e3631 (patch)
treec7d3183929c3681fc827021bbca8dc0e9693ab54 /src/script/cpp_api/s_base.cpp
parentf3e741dad1311e0b4057b530386e246f921be52c (diff)
downloaddragonfireclient-5131675a60a73ebc2bb06e343e296950682e3631.tar.xz
Add guards to stop server build fail
Diffstat (limited to 'src/script/cpp_api/s_base.cpp')
-rw-r--r--src/script/cpp_api/s_base.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp
index 867f61e0c..5711ccbfd 100644
--- a/src/script/cpp_api/s_base.cpp
+++ b/src/script/cpp_api/s_base.cpp
@@ -361,9 +361,11 @@ void ScriptApiBase::addObjectReference(ActiveObject *cobj)
//infostream<<"scriptapi_add_object_reference: id="<<cobj->getId()<<std::endl;
// Create object on stack
+#ifndef SERVER
if (m_type == ScriptingType::Client)
ClientObjectRef::create(L, dynamic_cast<ClientActiveObject *>(cobj));
else
+#endif
ObjectRef::create(L, dynamic_cast<ServerActiveObject *>(cobj)); // Puts ObjectRef (as userdata) on stack
int object = lua_gettop(L);
@@ -394,9 +396,11 @@ void ScriptApiBase::removeObjectReference(ActiveObject *cobj)
lua_pushnumber(L, cobj->getId()); // Push id
lua_gettable(L, objectstable);
// Set object reference to NULL
+#ifndef SERVER
if (m_type == ScriptingType::Client)
ClientObjectRef::set_null(L);
else
+#endif
ObjectRef::set_null(L);
lua_pop(L, 1); // pop object