fix lua result serialization causing various issues

for example, loading a library which returns a table of functions would
fail with an inexplicable (to the user) error about serialization. This
is now fixed. We no longer use a single result type, instead there are
void results and normal results, and the former simply never has to
worry about the result.

This was likely causing even more issues; if the `sol::object` was
populated before, it hitting the dtor in another path would, again, like
we've seen before, corrupt the lua stack.
This commit is contained in:
Lion Kortlepel
2026-04-29 18:29:02 +00:00
parent 57fe7cb055
commit 4104dc1f18
7 changed files with 319 additions and 100 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ void TPluginMonitor::operator()() {
auto Res = mEngine->EnqueueScript(StateID, Chunk);
Res->WaitUntilReady();
if (Res->IsError()) {
auto Snapshot = Res->GetDetachedSnapshot();
auto Snapshot = Res->GetSnapshot();
beammp_lua_errorf("Error while hot-reloading \"{}\": {}", Pair.first, Snapshot.ErrorMessage);
} else {
mEngine->ReportErrors(mEngine->TriggerLocalEvent(StateID, "onInit"));