From 05fae1eb1a8756799623116c5e3a4c03f62234bf Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 17 Sep 2019 03:21:10 +0000 Subject: [PATCH] This fixes the shrinker in E1L4 I wonder what it breaks! :D git-svn-id: https://svn.eduke32.com/eduke32@8117 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index 666e82330..faa37b61e 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -498,25 +498,16 @@ int32_t A_MoveSpriteClipdist(int32_t spriteNum, vec3_t const * const change, uin int returnValue; int32_t diffZ; - spriteheightofs(spriteNum, &diffZ, 0); - int newZ = pSprite->z - diffZ; + spriteheightofs(spriteNum, &diffZ, 1); - pSprite->z -= diffZ >> 1; - switch (pSprite->statnum) + if (pSprite->statnum == STAT_PROJECTILE) + returnValue = clipmovex(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, diffZ >> 3, diffZ >> 3, clipType, 1); + else { - default: - { - returnValue = clipmove(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, ZOFFSET6, ZOFFSET6, clipType); - break; - } - - case STAT_PROJECTILE: - { - returnValue = clipmovex(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, diffZ >> 1, diffZ >> 1, clipType, 1); - break; - } + pSprite->z -= diffZ >> 1; + returnValue = clipmove(&pSprite->pos, &newSectnum, change->x << 13, change->y << 13, clipDist, ZOFFSET6, ZOFFSET6, clipType); + pSprite->z += diffZ >> 1; } - pSprite->z += diffZ >> 1; // Testing: For some reason the assert below this was tripping for clients EDUKE32_UNUSED int16_t dbg_ClipMoveSectnum = newSectnum; @@ -565,6 +556,7 @@ int32_t A_MoveSpriteClipdist(int32_t spriteNum, vec3_t const * const change, uin Bassert(newSectnum == pSprite->sectnum); + int newZ = pSprite->z; int32_t ceilhit, florhit; int const doZUpdate = change->z ? A_CheckNeedZUpdate(spriteNum, change->z, &newZ, &ceilhit, &florhit) : 0;