diff --git a/src/network/ws/wssocket.cpp b/src/network/ws/wssocket.cpp index c0d74c622..e3f95fa03 100644 --- a/src/network/ws/wssocket.cpp +++ b/src/network/ws/wssocket.cpp @@ -223,7 +223,9 @@ void WSSocket::on_message(const websocketpp::connection_hdl &hdl, const message_ } std::string s{msg->get_payload().data(), msg->get_payload().size()}; +#if !NDEBUG cs << "A message: " << msg->get_payload().size() << " " << msg->get_payload() << '\n'; +#endif incoming_queue.emplace_back(queue_item{a, std::move(s)}); } diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp index 724d43a60..f70657500 100644 --- a/src/script/cpp_api/s_base.cpp +++ b/src/script/cpp_api/s_base.cpp @@ -67,6 +67,7 @@ ScriptApiBase::ScriptApiBase(ScriptingType type): #ifdef SCRIPTAPI_LOCK_DEBUG m_lock_recursion_count = 0; #endif + m_luastack = luaL_newstate(); FATAL_ERROR_IF(!m_luastack, "luaL_newstate() failed"); @@ -497,7 +498,7 @@ void ScriptApiBase::objectrefGetOrCreate(lua_State *L, ServerActiveObject *cobj) errorstream << "ScriptApiBase::objectrefGetOrCreate(): " << "Pushing orphan ObjectRef. Please open a bug report for this." << std::endl; - assert(0); + //assert(0); ObjectRef::create(L, cobj); } else { push_objectRef(L, cobj->getId()); diff --git a/src/script/cpp_api/s_entity.cpp b/src/script/cpp_api/s_entity.cpp index f55a0b0a4..e593adeca 100644 --- a/src/script/cpp_api/s_entity.cpp +++ b/src/script/cpp_api/s_entity.cpp @@ -226,7 +226,7 @@ void ScriptApiEntity::luaentity_GetProperties(u16 id, bool ScriptApiEntity::luaentity_Step(u16 id, float dtime, const collisionMoveResult *moveresult) { - TRY_SCRIPTAPI_PRECHECKHEADER({}) + TRY_SCRIPTAPI_PRECHECKHEADER(true) int error_handler = PUSH_ERROR_HANDLER(L); diff --git a/src/server/activeobjectmgr.cpp b/src/server/activeobjectmgr.cpp index 7ad14fc6e..3e84ec21f 100644 --- a/src/server/activeobjectmgr.cpp +++ b/src/server/activeobjectmgr.cpp @@ -177,6 +177,11 @@ void ActiveObjectMgr::removeObject(u16 id) void ActiveObjectMgr::invalidateActiveObjectObserverCaches() { + const auto lock = m_active_objects.try_lock_shared_rec(); + if (!lock->owns_lock()) { + return; + } + for (auto &active_object : m_active_objects.iter()) { ServerActiveObject *obj = active_object.second.get(); if (!obj)