Some corrections to lpxclient code

This commit is contained in:
2025-06-27 20:03:38 -04:00
parent 88b02c5458
commit c0307b970b
5 changed files with 17 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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.
//

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {