commit c7de2fba6c30125cd775d17cd90ce2698081b7ac
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Fri Mar 19 08:15:56 2021 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Fri Mar 19 08:15:56 2021 -0600
update print to match pico 8 for functions
---
source/picoluaapi.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/source/picoluaapi.cpp b/source/picoluaapi.cpp
index 1ab4edb..85a0004 100644
--- a/source/picoluaapi.cpp
+++ b/source/picoluaapi.cpp
@@ -302,6 +302,9 @@ int print(lua_State *L){
else if (lua_isboolean(L, 1)){
str = lua_toboolean(L, 1) ? "true" : "false";
}
+ else if (lua_isfunction(L, 1)){
+ str = "[function]";
+ }
if (lua_gettop(L) < 3) {
_graphicsForLuaApi->print(str);
@@ -841,7 +844,7 @@ int printh(lua_State *L) {
if (lua_isstring(L, 1)){
const char * str = "";
str = lua_tolstring(L, 1, nullptr);
- printf("%s", str);
+ printf("%s\n", str);
}
return 0;
}