#484 small fix
This commit is contained in:
@@ -276,13 +276,13 @@ static s32 duk_keyp(duk_context* duk)
|
|||||||
if(key >= TIC_KEYS_COUNT)
|
if(key >= TIC_KEYS_COUNT)
|
||||||
{
|
{
|
||||||
duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
duk_error(duk, DUK_ERR_ERROR, "unknown keyboard code\n");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(duk_is_null_or_undefined(duk, 1) && duk_is_null_or_undefined(duk, 2))
|
if(duk_is_null_or_undefined(duk, 1) && duk_is_null_or_undefined(duk, 2))
|
||||||
{
|
{
|
||||||
duk_push_boolean(duk, tic->api.keyp(tic, key, -1, -1));
|
duk_push_boolean(duk, tic->api.keyp(tic, key, -1, -1));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -290,12 +290,11 @@ static s32 duk_keyp(duk_context* duk)
|
|||||||
u32 period = duk_to_int(duk, 2);
|
u32 period = duk_to_int(duk, 2);
|
||||||
|
|
||||||
duk_push_boolean(duk, tic->api.keyp(tic, key, hold, period));
|
duk_push_boolean(duk, tic->api.keyp(tic, key, hold, period));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static duk_ret_t duk_sfx(duk_context* duk)
|
static duk_ret_t duk_sfx(duk_context* duk)
|
||||||
|
|||||||
11
src/luaapi.c
11
src/luaapi.c
@@ -836,8 +836,6 @@ static s32 lua_keyp(lua_State* lua)
|
|||||||
if(top == 1)
|
if(top == 1)
|
||||||
{
|
{
|
||||||
lua_pushboolean(lua, tic->api.keyp(tic, key, -1, -1));
|
lua_pushboolean(lua, tic->api.keyp(tic, key, -1, -1));
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
else if(top == 3)
|
else if(top == 3)
|
||||||
{
|
{
|
||||||
@@ -845,13 +843,16 @@ static s32 lua_keyp(lua_State* lua)
|
|||||||
u32 period = getLuaNumber(lua, 3);
|
u32 period = getLuaNumber(lua, 3);
|
||||||
|
|
||||||
lua_pushboolean(lua, tic->api.keyp(tic, key, hold, period));
|
lua_pushboolean(lua, tic->api.keyp(tic, key, hold, period));
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
else luaL_error(lua, "invalid params, keyp [ code [ hold period ] ]\n");
|
else
|
||||||
|
{
|
||||||
|
luaL_error(lua, "invalid params, keyp [ code [ hold period ] ]\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static s32 lua_memcpy(lua_State* lua)
|
static s32 lua_memcpy(lua_State* lua)
|
||||||
|
|||||||
Reference in New Issue
Block a user