Fix being squished in sectors with little headroom but extended non-blocking

ceilings or floors. In such cases, you're not squished unconditionally (instead
of fetching the ceiling or floor height of the neighbor sector), but TROR isn't
meant for small-scale RoR anyway.

git-svn-id: https://svn.eduke32.com/eduke32@2071 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-10-03 17:44:06 +00:00
parent 2a4a7cd731
commit 9b04832153
1 changed files with 19 additions and 4 deletions

View File

@ -125,12 +125,27 @@ static inline int32_t VM_CheckSquished(void)
{ {
sectortype *sc = &sector[vm.g_sp->sectnum]; sectortype *sc = &sector[vm.g_sp->sectnum];
if ((vm.g_sp->picnum == APLAYER && ud.clipping) || sc->lotag == 23 || if ((vm.g_sp->picnum == APLAYER && ud.clipping) || sc->lotag == 23)
(vm.g_sp->pal == 1 ?
!(sc->floorz - sc->ceilingz < (32<<8) && (sc->lotag&32768) == 0) :
!(sc->floorz - sc->ceilingz < (12<<8))))
return 0; return 0;
{
int32_t fz=sc->floorz, cz=sc->ceilingz;
#ifdef YAX_ENABLE
int16_t cb, fb;
yax_getbunches(vm.g_sp->sectnum, &cb, &fb);
if (cb >= 0 && (sc->ceilingstat&512)==0) // if ceiling non-blocking...
cz -= (32<<8); // don't squish unconditionally... yax_getneighborsect is slowish :/
if (fb >= 0 && (sc->floorstat&512)==0)
fz += (32<<8);
#endif
if (vm.g_sp->pal == 1 ?
(fz - cz >= (32<<8) || (sc->lotag&32768)) :
(fz - cz >= (12<<8)))
return 0;
}
P_DoQuote(QUOTE_SQUISHED, g_player[vm.g_p].ps); P_DoQuote(QUOTE_SQUISHED, g_player[vm.g_p].ps);
if (A_CheckEnemySprite(vm.g_sp)) vm.g_sp->xvel = 0; if (A_CheckEnemySprite(vm.g_sp)) vm.g_sp->xvel = 0;