Allow access to bluescore and redscore

This commit is contained in:
Steel Titanium 2019-12-19 01:14:34 -05:00 committed by Jaime Passos
parent 7efd9662d1
commit a39b6a1286
2 changed files with 19 additions and 0 deletions

View File

@ -10822,6 +10822,12 @@ static inline int lib_getenum(lua_State *L)
} else if (fastcmp(word,"paused")) {
lua_pushboolean(L, paused);
return 1;
} else if (fastcmp(word,"bluescore")) {
lua_pushinteger(L, bluescore);
return 1;
} else if (fastcmp(word,"redscore")) {
lua_pushinteger(L, redscore);
return 1;
// begin map vars
} else if (fastcmp(word,"spstage_start")) {
lua_pushinteger(L, spstage_start);
@ -11035,6 +11041,8 @@ static int lib_getActionName(lua_State *L)
return luaL_typerror(L, 1, "action userdata or Lua function");
}
int LUA_SOCLib(lua_State *L)
{
lua_register(L,"freeslot",lib_freeslot);

View File

@ -106,6 +106,17 @@ static int noglobals(lua_State *L)
return 0;
}
if (fastcmp(csname,"redscore"))
{
redscore = (UINT32)luaL_checkinteger(L, 2);
return 0;
}
else if (fastcmp(csname,"bluescore"))
{
bluescore = (UINT32)luaL_checkinteger(L, 2);
return 0;
}
Z_Free(name);
return luaL_error(L, "Implicit global " LUA_QS " prevented. Create a local variable instead.", csname);
}