Allow access to bluescore and redscore
This commit is contained in:
parent
7efd9662d1
commit
a39b6a1286
|
@ -10822,6 +10822,12 @@ static inline int lib_getenum(lua_State *L)
|
||||||
} else if (fastcmp(word,"paused")) {
|
} else if (fastcmp(word,"paused")) {
|
||||||
lua_pushboolean(L, paused);
|
lua_pushboolean(L, paused);
|
||||||
return 1;
|
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
|
// begin map vars
|
||||||
} else if (fastcmp(word,"spstage_start")) {
|
} else if (fastcmp(word,"spstage_start")) {
|
||||||
lua_pushinteger(L, 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");
|
return luaL_typerror(L, 1, "action userdata or Lua function");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int LUA_SOCLib(lua_State *L)
|
int LUA_SOCLib(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_register(L,"freeslot",lib_freeslot);
|
lua_register(L,"freeslot",lib_freeslot);
|
||||||
|
|
|
@ -106,6 +106,17 @@ static int noglobals(lua_State *L)
|
||||||
return 0;
|
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);
|
Z_Free(name);
|
||||||
return luaL_error(L, "Implicit global " LUA_QS " prevented. Create a local variable instead.", csname);
|
return luaL_error(L, "Implicit global " LUA_QS " prevented. Create a local variable instead.", csname);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue