mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'customexitvars-rework' into 'next'
Rework G_SetCustomExitVars to allow skipstats 2 See merge request STJr/SRB2!534
This commit is contained in:
commit
74091c294d
1 changed files with 8 additions and 14 deletions
|
|
@ -2664,23 +2664,17 @@ static int lib_gSetCustomExitVars(lua_State *L)
|
||||||
// Supported:
|
// Supported:
|
||||||
// G_SetCustomExitVars(); [reset to defaults]
|
// G_SetCustomExitVars(); [reset to defaults]
|
||||||
// G_SetCustomExitVars(int) [nextmap override only]
|
// G_SetCustomExitVars(int) [nextmap override only]
|
||||||
// G_SetCustomExitVars(bool) [skipstats only]
|
// G_SetCustomExitVars(nil, int) [skipstats only]
|
||||||
// G_SetCustomExitVars(int, bool) [both of the above]
|
// G_SetCustomExitVars(int, int) [both of the above]
|
||||||
|
|
||||||
|
nextmapoverride = 0;
|
||||||
|
skipstats = 0;
|
||||||
|
|
||||||
if (n >= 1)
|
if (n >= 1)
|
||||||
{
|
{
|
||||||
if (lua_isnumber(L, 1) || n >= 2)
|
nextmapoverride = (INT16)luaL_optinteger(L, 1, 0);
|
||||||
{
|
skipstats = (INT16)luaL_optinteger(L, 2, 0);
|
||||||
nextmapoverride = (INT16)luaL_checknumber(L, 1);
|
|
||||||
lua_remove(L, 1); // remove nextmapoverride; skipstats now 1 if available
|
|
||||||
}
|
|
||||||
skipstats = luaL_optinteger(L, 2, 0);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
nextmapoverride = 0;
|
|
||||||
skipstats = 0;
|
|
||||||
}
|
|
||||||
// ---
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue