From 933c1ac6c3acd14d66e0dfab9c6f2d83e46ddd5c Mon Sep 17 00:00:00 2001 From: jyelon Date: Thu, 21 May 2026 19:40:30 -0400 Subject: [PATCH] More tweaks on tracebacks --- Docs/TODO-List.md | 2 ++ luprex/cpp/core/traceback.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Docs/TODO-List.md b/Docs/TODO-List.md index 9f01ff1f..e665bc9c 100644 --- a/Docs/TODO-List.md +++ b/Docs/TODO-List.md @@ -1,6 +1,8 @@ +* Add a slash-command to reload lua source code. + * Skeletal Mesh Tangible * Implement Interactive Temporary Variables diff --git a/luprex/cpp/core/traceback.cpp b/luprex/cpp/core/traceback.cpp index 9856769c..556d556a 100644 --- a/luprex/cpp/core/traceback.cpp +++ b/luprex/cpp/core/traceback.cpp @@ -50,9 +50,16 @@ int traceback_coroutine(lua_State *L) { if ((ar.currentline > 0) || (*ar.namewhat != 0) || (*ar.what != 'C')) { any = true; lua_pushliteral(L, "\n\t"); - lua_pushfstring(L, "%s", ar.short_src); - if (ar.currentline > 0 && strcmp(ar.short_src, "")) - lua_pushfstring(L, " line %d", ar.currentline); + if (strcmp(ar.short_src, "")==0) + { + lua_pushstring(L, "in the console"); + } + else + { + lua_pushfstring(L, "in %s", ar.short_src); + if (ar.currentline > 0) + lua_pushfstring(L, " line %d", ar.currentline); + } if (*ar.namewhat != '\0') /* is there a name? */ lua_pushfstring(L, " in function " LUA_QS, ar.name); else {