foxygit / fake-08-xbox360 Log in
commit 34b687d45406ea6f8633e26b74b01e7955f7543e
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Fri Apr 16 21:27:28 2021 -0600
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Fri Apr 16 21:27:28 2021 -0600

    stub out keyboard input to return correct types
---
 source/picoluaapi.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/source/picoluaapi.cpp b/source/picoluaapi.cpp
index d1f7169..f5fa0f3 100644
--- a/source/picoluaapi.cpp
+++ b/source/picoluaapi.cpp
@@ -797,6 +797,16 @@ int stat(lua_State *L) {
             lua_pushnumber(L, _vmForLuaApi->getTargetFps());
             return 1;
         break;
+        //was a key pressed (always false)
+        case 30:
+            lua_pushboolean(L, false);
+            return 1;
+        break;
+        //string of key pressed
+        case 31:
+            lua_pushstring(L, "");
+            return 1;
+        break;
         //mouse x
         case 32:
             lua_pushnumber(L, _inputForLuaApi->getMouseX());
@@ -986,6 +996,9 @@ int reload(lua_State *L) {
     }
     if (lua_gettop(L) > 3) {
         str = lua_tolstring(L, 4, nullptr);
+        if (str == nullptr) {
+            str = "";
+        }
     }

     _vmForLuaApi->vm_reload(dest, src, len, str);