mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-22 16:02:29 +00:00
Change getSpritePatch and getSpritePatch to accept angles 1-8 instead of 0-7, and just decrement the numbers internally
0 now just defaults to front angle (1, or 0 internally), in case people thought it was a separate angle from 1-8 for some reason
This commit is contained in:
parent
e32774a604
commit
4d740ff783
1 changed files with 18 additions and 4 deletions
|
|
@ -384,8 +384,15 @@ static int libd_getSpritePatch(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
// set angle number
|
// set angle number
|
||||||
sprframe = &sprdef->spriteframes[frame];
|
sprframe = &sprdef->spriteframes[frame];
|
||||||
angle = luaL_optinteger(L, 3, 0);
|
angle = luaL_optinteger(L, 3, 1);
|
||||||
if (angle >= 8)
|
|
||||||
|
// convert WAD editor angle numbers (1-8) to internal angle numbers (0-7)
|
||||||
|
// keep 0 the same since we'll make it default to angle 1 (which is internally 0)
|
||||||
|
// in case somebody didn't know that angle 0 really just maps all 8 angles to the same patch
|
||||||
|
if (angle != 0)
|
||||||
|
angle--;
|
||||||
|
|
||||||
|
if (angle >= 8) // out of range?
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// push both the patch and it's "flip" value
|
// push both the patch and it's "flip" value
|
||||||
|
|
@ -470,8 +477,15 @@ static int libd_getSprite2Patch(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
// set angle number
|
// set angle number
|
||||||
sprframe = &sprdef->spriteframes[frame];
|
sprframe = &sprdef->spriteframes[frame];
|
||||||
angle = luaL_optinteger(L, 3, 0);
|
angle = luaL_optinteger(L, 3, 1);
|
||||||
if (angle >= 8)
|
|
||||||
|
// convert WAD editor angle numbers (1-8) to internal angle numbers (0-7)
|
||||||
|
// keep 0 the same since we'll make it default to angle 1 (which is internally 0)
|
||||||
|
// in case somebody didn't know that angle 0 really just maps all 8 angles to the same patch
|
||||||
|
if (angle != 0)
|
||||||
|
angle--;
|
||||||
|
|
||||||
|
if (angle >= 8) // out of range?
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// push both the patch and it's "flip" value
|
// push both the patch and it's "flip" value
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue