Mapster32: fix cycling picnum in 3D mode.

Using non-keypad [-]/[+] or LMB + mousewheel, it was broken when a void
tile was in between.

git-svn-id: https://svn.eduke32.com/eduke32@3203 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-17 19:46:33 +00:00
parent 44904b12be
commit dd424fac70

View file

@ -5650,14 +5650,16 @@ static void Keys3d(void)
{ {
if (ASSERT_AIMING) if (ASSERT_AIMING)
{ {
j = i = (keystatus[KEYSC_EQUAL] || (bstatus&16)) ? 1 : -1; int32_t pic = AIMED_SELOVR_PICNUM;
int32_t dir = (keystatus[KEYSC_EQUAL] || (bstatus&16)) ? 1 : -1;
while (!tilesizx[AIMED_SELOVR_PICNUM] || !tilesizy[AIMED_SELOVR_PICNUM] || j) do
{ {
i += AIMED_SELOVR_PICNUM + MAXTILES; pic += dir + MAXTILES;
AIMED_SELOVR_PICNUM = i % MAXTILES; pic %= MAXTILES;
j = 0;
} }
while (tilesizx[pic]<=0 || tilesizy[pic]<=0);
AIMED_SELOVR_PICNUM = pic;
if (AIMING_AT_SPRITE) if (AIMING_AT_SPRITE)
correct_sprite_yoffset(searchwall); correct_sprite_yoffset(searchwall);