mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-05 18:41:05 +00:00
Improve Script CPP API diagnostics
This commit is contained in:
parent
3183d5a403
commit
bcf47bc67c
16 changed files with 129 additions and 107 deletions
|
@ -164,9 +164,7 @@ void AsyncEngine::step(lua_State *L, int errorhandler)
|
|||
lua_pushlstring(L, jobDone.serializedResult.data(),
|
||||
jobDone.serializedResult.size());
|
||||
|
||||
if (lua_pcall(L, 2, 0, errorhandler)) {
|
||||
script_error(L);
|
||||
}
|
||||
PCALL_RESL(L, lua_pcall(L, 2, 0, errorhandler));
|
||||
}
|
||||
resultQueueMutex.Unlock();
|
||||
lua_pop(L, 1); // Pop core
|
||||
|
@ -293,8 +291,9 @@ void* AsyncWorkerThread::Thread()
|
|||
toProcess.serializedParams.data(),
|
||||
toProcess.serializedParams.size());
|
||||
|
||||
if (lua_pcall(L, 2, 1, m_errorhandler)) {
|
||||
scriptError();
|
||||
int result = lua_pcall(L, 2, 1, m_errorhandler);
|
||||
if (result) {
|
||||
PCALL_RES(result);
|
||||
toProcess.serializedResult = "";
|
||||
} else {
|
||||
// Fetch result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue