mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 23:41:48 +00:00
Use modulo, not bitwise AND. My fault once again, whoops.
The point here is ColorOpposite(MAXSKINCOLORS) would have given an actual result of its own since MAXSKINCOLORS & MAXSKINCOLORS is still MAXSKINCOLORS. This shouldn't happen though, as both Color_Opposite[MAXSKINCOLORS*2] and Color_Opposite[MAXSKINCOLOR*2+1] aren't defined.
This commit is contained in:
parent
0f2a092741
commit
f2f8906a19
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!
|
// Returns both color and frame numbers!
|
||||||
static int lib_coloropposite(lua_State *L)
|
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]); // push color
|
||||||
lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame
|
lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame
|
||||||
return 2;
|
return 2;
|
||||||
|
|
Loading…
Reference in a new issue