Don't squish the player in lotag 1 sectors that have a SE7.

git-svn-id: https://svn.eduke32.com/eduke32@5657 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-03-14 00:07:12 +00:00
parent 0dda248b3f
commit 9c927bcb36
3 changed files with 17 additions and 15 deletions

View file

@ -330,7 +330,7 @@ static int32_t Proj_MaybeDoTransport(int32_t spritenum, const tspritetype * cons
// Check whether sprite <s> is on/in a non-SE7 water sector.
// <othersectptr>: if not NULL, the sector on the other side.
static int32_t A_CheckNoSE7Water(const spritetype *s, int32_t sectnum, int32_t slotag, int32_t *othersectptr)
int32_t A_CheckNoSE7Water(const spritetype *s, int32_t sectnum, int32_t slotag, int32_t *othersectptr)
{
if (slotag==ST_1_ABOVE_WATER || slotag==ST_2_UNDERWATER)
{

View file

@ -301,6 +301,7 @@ extern projectile_t SpriteProjectile[MAXSPRITES];
void A_AddToDeleteQueue(int32_t i);
int32_t A_CheckNoSE7Water(const spritetype *s, int32_t sectnum, int32_t slotag, int32_t *othersectptr);
int32_t A_CheckSwitchTile(int32_t i);
void A_DeleteSprite(int32_t s);
void A_DoGuts(int32_t sp,int32_t gtype,int32_t n);

View file

@ -239,26 +239,27 @@ static int32_t VM_CheckSquished(void)
{
sectortype const * const sc = &sector[vm.g_sp->sectnum];
if (sc->lotag == ST_23_SWINGING_DOOR || EDUKE32_PREDICT_FALSE(vm.g_sp->picnum == APLAYER && ud.noclip))
if (sc->lotag == ST_23_SWINGING_DOOR ||
(sc->lotag == ST_1_ABOVE_WATER && !A_CheckNoSE7Water(vm.g_sp, vm.g_sp->sectnum, sc->lotag, NULL)) ||
(vm.g_sp->picnum == APLAYER && ud.noclip))
return 0;
{
int32_t fz=sc->floorz, cz=sc->ceilingz;
int32_t fz=sc->floorz, cz=sc->ceilingz;
#ifdef YAX_ENABLE
int16_t cb, fb;
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); // unconditionally don't squish... yax_getneighborsect is slowish :/
if (fb >= 0 && (sc->floorstat&512)==0)
fz += (32<<8);
yax_getbunches(vm.g_sp->sectnum, &cb, &fb);
if (cb >= 0 && (sc->ceilingstat&512)==0) // if ceiling non-blocking...
cz -= (32<<8); // unconditionally don't squish... 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;
}
if (vm.g_sp->pal == 1 ?
(fz - cz >= (32<<8) || (sc->lotag&32768)) :
(fz - cz >= (12<<8)))
return 0;
P_DoQuote(QUOTE_SQUISHED, vm.g_pp);