Mapster32: for c&p-ing map portions w/o TROR, fix wrongly resetting wall lotag/extra

git-svn-id: https://svn.eduke32.com/eduke32@2965 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-08-26 22:10:40 +00:00
parent f133be4ae8
commit 948a716229
3 changed files with 13 additions and 5 deletions

View file

@ -103,6 +103,7 @@ void yax_updategrays(int32_t posze);
// more user tag hijacking: lotag/extra :/ // more user tag hijacking: lotag/extra :/
# define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(&Ptr[Wall].lotag + 2*Cf)) # define YAX_PTRNEXTWALL(Ptr, Wall, Cf) (*(&Ptr[Wall].lotag + 2*Cf))
# define YAX_NEXTWALL(Wall, Cf) YAX_PTRNEXTWALL(wall, Wall, Cf) # define YAX_NEXTWALL(Wall, Cf) YAX_PTRNEXTWALL(wall, Wall, Cf)
# define YAX_NEXTWALLDEFAULT(Cf) (((Cf)==YAX_CEILING) ? 0 : -1)
# define YAX_ITER_WALLS(Wal, Itervar, Cfvar) Cfvar=0, Itervar=(Wal); Itervar!=-1; \ # define YAX_ITER_WALLS(Wal, Itervar, Cfvar) Cfvar=0, Itervar=(Wal); Itervar!=-1; \
Itervar=yax_getnextwall(Itervar, Cfvar), \ Itervar=yax_getnextwall(Itervar, Cfvar), \

View file

@ -1659,12 +1659,18 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo)
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
if (mapinfo->numyaxbunches > 0) if (mapinfo->numyaxbunches > 0)
{ {
int32_t ynw, cf; int32_t cf;
for (cf=0; cf<2; cf++) for (cf=0; cf<2; cf++)
{ {
ynw = yax_getnextwall(m+j, cf); const int32_t ynw = yax_getnextwall(m+j, cf);
mapinfo->ynextwall[2*(tmpnumwalls+j) + cf] = (ynw >= 0) ? otonwall[ynw] : -1; const int32_t nynw = (ynw >= 0) ? otonwall[ynw] : -1;
if (mapinfo->numyaxbunches > 0)
mapinfo->ynextwall[2*(tmpnumwalls+j) + cf] = nynw;
if (ynw >= 0 && nynw < 0) // CLEAR_YNEXTWALLS
YAX_PTRNEXTWALL(mapinfo->wall, tmpnumwalls+j, cf) = YAX_NEXTWALLDEFAULT(cf);
} }
} }
#endif #endif
@ -1763,7 +1769,8 @@ static int32_t restore_highlighted_map(mapinfofull_t *mapinfo, int32_t forreal)
yax_setnextwall(i, j, mapinfo->ynextwall[2*(i-numwalls) + j]>=0 ? yax_setnextwall(i, j, mapinfo->ynextwall[2*(i-numwalls) + j]>=0 ?
numwalls+mapinfo->ynextwall[2*(i-numwalls) + j] : -1); numwalls+mapinfo->ynextwall[2*(i-numwalls) + j] : -1);
else else
yax_setnextwall(i, j, -1); wall[i].cstat &= ~YAX_NEXTWALLBIT(j); // CLEAR_YNEXTWALLS
// yax_setnextwall(i, j, -1);
} }
#endif #endif
} }

View file

@ -412,7 +412,7 @@ void yax_setnextwall(int16_t wal, int16_t cf, int16_t thenextwall)
else else
{ {
wall[wal].cstat &= ~YAX_NEXTWALLBIT(cf); wall[wal].cstat &= ~YAX_NEXTWALLBIT(cf);
YAX_NEXTWALL(wal, cf) = cf?-1:0; YAX_NEXTWALL(wal, cf) = YAX_NEXTWALLDEFAULT(cf);
} }
} }