From 9c927bcb365d1745f578b1e3203f4331b6a033a3 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 14 Mar 2016 00:07:12 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/actors.c | 2 +- polymer/eduke32/source/actors.h | 1 + polymer/eduke32/source/gameexec.c | 29 +++++++++++++++-------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 8c2db0e0f..cede59cb7 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -330,7 +330,7 @@ static int32_t Proj_MaybeDoTransport(int32_t spritenum, const tspritetype * cons // Check whether sprite is on/in a non-SE7 water sector. // : 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) { diff --git a/polymer/eduke32/source/actors.h b/polymer/eduke32/source/actors.h index 4f10761b1..ce4c95a0e 100644 --- a/polymer/eduke32/source/actors.h +++ b/polymer/eduke32/source/actors.h @@ -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); diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 214743a29..f8813967a 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -239,26 +239,27 @@ static int32_t VM_CheckSquished(void) { sectortype const * const sc = §or[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);