diff --git a/luprex/cpp/core/drivenengine.cpp b/luprex/cpp/core/drivenengine.cpp index a212a2bf..6b4474d8 100644 --- a/luprex/cpp/core/drivenengine.cpp +++ b/luprex/cpp/core/drivenengine.cpp @@ -165,8 +165,8 @@ void DrivenEngine::set_console_prompt(const eng::string &prompt) { console_prompt_ = prompt; } -void DrivenEngine::rescan_lua_source() { - rescan_lua_source_ = true; +void DrivenEngine::rescan_lua_source(bool b) { + rescan_lua_source_ = b; } void DrivenEngine::set_visible_world_and_actor(World *w, int64_t id) { diff --git a/luprex/cpp/core/drivenengine.hpp b/luprex/cpp/core/drivenengine.hpp index 12e2c3e5..a6a92138 100644 --- a/luprex/cpp/core/drivenengine.hpp +++ b/luprex/cpp/core/drivenengine.hpp @@ -222,7 +222,7 @@ public: // DRIVER: this merely sets a flag, which the driver will notice later, // causing the driver to update the lua source. // - void rescan_lua_source(); + void rescan_lua_source(bool b); // Set the world pointer and the actor ID. // diff --git a/luprex/cpp/core/eng-tests.cpp b/luprex/cpp/core/eng-tests.cpp index b26b26b5..73ab1e26 100644 --- a/luprex/cpp/core/eng-tests.cpp +++ b/luprex/cpp/core/eng-tests.cpp @@ -108,7 +108,7 @@ public: RunUnitTests() { world_.reset(new World(WORLD_TYPE_MASTER)); stop_driver(); - rescan_lua_source(); + rescan_lua_source(true); } virtual void event_access(AccessKind kind, int64_t place_id, std::string_view datapk, StreamBuffer *retpk) override { diff --git a/luprex/cpp/core/lpxclient.cpp b/luprex/cpp/core/lpxclient.cpp index d2a796a3..cd280c89 100644 --- a/luprex/cpp/core/lpxclient.cpp +++ b/luprex/cpp/core/lpxclient.cpp @@ -50,6 +50,12 @@ public: // Reset the print channeler print_channeler_.reset(); + + // Do not trigger lua source loading. + rescan_lua_source(false); + + // Clear any saved invocations + delayed_invocations_.clear(); } void set_initial_state_standalone() { @@ -72,7 +78,10 @@ public: print_channeler_.reset(); // Trigger lua source loading. - rescan_lua_source(); + rescan_lua_source(true); + + // Clear any saved invocations + delayed_invocations_.clear(); } // When the world is in synchronous mode, there's no @@ -140,7 +149,7 @@ public: } virtual void do_cpl_command() override { - rescan_lua_source(); + rescan_lua_source(true); } virtual void do_work_command() override { diff --git a/luprex/cpp/core/lpxserver.cpp b/luprex/cpp/core/lpxserver.cpp index 5b191e0d..66a34cf5 100644 --- a/luprex/cpp/core/lpxserver.cpp +++ b/luprex/cpp/core/lpxserver.cpp @@ -58,7 +58,7 @@ public: set_visible_world_and_actor(master_.get(), admin_id_); // Trigger the loading of the lua source. - rescan_lua_source(); + rescan_lua_source(true); } virtual void do_syntax_error(std::string_view error) override { @@ -82,7 +82,7 @@ public: } virtual void do_cpl_command() override { - rescan_lua_source(); + rescan_lua_source(true); } virtual void do_work_command() override {