mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-26 11:10:55 +00:00
Merge branch 'coloropposite-hotfix' into 'next'
Coloropposite hotfix Quick fix to prevent ColorOpposite(MAXSKINCOLORS) or higher input from giving results out of the actual array's bounds. In other words, preventing it from giving you nonsense values or something. I created the function for Lua to begin with, so clearly this is 100% my fault once again. Welp. See merge request !31
This commit is contained in:
commit
61eb9c01d1
1 changed files with 1 additions and 1 deletions
|
@ -166,7 +166,7 @@ static int lib_all7emeralds(lua_State *L)
|
|||
// Returns both color and frame numbers!
|
||||
static int lib_coloropposite(lua_State *L)
|
||||
{
|
||||
int colornum = ((int)luaL_checkinteger(L, 1)) & MAXSKINCOLORS;
|
||||
int colornum = ((int)luaL_checkinteger(L, 1)) % MAXSKINCOLORS;
|
||||
lua_pushinteger(L, Color_Opposite[colornum*2]); // push color
|
||||
lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame
|
||||
return 2;
|
||||
|
|
Loading…
Reference in a new issue