get build working on Windows following cd9f145d

The code prior to cd9f145d would have returned 0 on an argc other
than 2 or 3 so this just does the same.
This commit is contained in:
nhmall
2023-06-24 13:18:16 -04:00
parent 2f25ee734e
commit 079ea3a449
+3 -2
View File
@@ -1519,16 +1519,16 @@ nhl_callback(lua_State *L)
return 0; return 0;
} }
if (argc == 2 || argc == 3) {
if (argc == 2) { if (argc == 2) {
rm = FALSE; rm = FALSE;
fn = luaL_checkstring(L, -1); fn = luaL_checkstring(L, -1);
cb = luaL_checkstring(L, -2); cb = luaL_checkstring(L, -2);
} else if (argc == 3) { } else {
rm = lua_toboolean(L, -1); rm = lua_toboolean(L, -1);
fn = luaL_checkstring(L, -2); fn = luaL_checkstring(L, -2);
cb = luaL_checkstring(L, -3); cb = luaL_checkstring(L, -3);
} }
for (i = 0; i < NUM_NHCB; i++) for (i = 0; i < NUM_NHCB; i++)
if (!strcmp(cb, nhcb_name[i])) if (!strcmp(cb, nhcb_name[i]))
break; break;
@@ -1547,6 +1547,7 @@ nhl_callback(lua_State *L)
lua_pushstring(gl.luacore, cb); lua_pushstring(gl.luacore, cb);
lua_pushstring(gl.luacore, fn); lua_pushstring(gl.luacore, fn);
nhl_pcall(gl.luacore, 2, 0); nhl_pcall(gl.luacore, 2, 0);
}
return 0; return 0;
} }