foxygit / fake-08-xbox360 Log in
commit c3ad5b35ee4f92b11196ea3888a964f575723ab5
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Thu Dec 24 08:33:27 2020 -0700
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Thu Dec 24 08:33:27 2020 -0700

    Fix default pal() arguments
---
 source/picoluaapi.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/source/picoluaapi.cpp b/source/picoluaapi.cpp
index fc913d8..9879962 100644
--- a/source/picoluaapi.cpp
+++ b/source/picoluaapi.cpp
@@ -529,7 +529,10 @@ int pal(lua_State *L) {


     uint8_t c0 = lua_tonumber(L,1);
-    uint8_t c1 = lua_tonumber(L,2);
+    uint8_t c1 = c0;
+    if (lua_gettop(L) > 1) {
+        c1 = lua_tonumber(L,2);
+    }
     uint8_t p = 0;

     if (lua_gettop(L) > 2){