From 21217585c901c224dc5b0aaae2e4a7f2e7c3290e Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 19 Mar 2019 22:09:26 +0000 Subject: [PATCH] Fix crash when starting E2L1 git-svn-id: https://svn.eduke32.com/eduke32@7440 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.h | 9 ++++++++- source/duke3d/src/gameexec.cpp | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/duke3d/src/actors.h b/source/duke3d/src/actors.h index f257a331d..4c411a6e6 100644 --- a/source/duke3d/src/actors.h +++ b/source/duke3d/src/actors.h @@ -499,11 +499,18 @@ ACTOR_INLINE int A_CheckEnemyTile(int const tileNum) ACTOR_INLINE int A_SetSprite(int const spriteNum, uint32_t cliptype) { - vec3_t davect = { (sprite[spriteNum].xvel * (sintable[(sprite[spriteNum].ang + 512) & 2047])) >> 14, + vec3_t const davect = { (sprite[spriteNum].xvel * (sintable[(sprite[spriteNum].ang + 512) & 2047])) >> 14, (sprite[spriteNum].xvel * (sintable[sprite[spriteNum].ang & 2047])) >> 14, sprite[spriteNum].zvel }; return (A_MoveSprite(spriteNum, &davect, cliptype) == 0); } +ACTOR_INLINE int A_SetSpriteNoZ(int const spriteNum, uint32_t cliptype) +{ + vec3_t const davect = { (sprite[spriteNum].xvel * (sintable[(sprite[spriteNum].ang + 512) & 2047])) >> 14, + (sprite[spriteNum].xvel * (sintable[sprite[spriteNum].ang & 2047])) >> 14, 0 }; + return (A_MoveSprite(spriteNum, &davect, cliptype) == 0); +} + ACTOR_INLINE int32_t A_MoveSprite(int const spriteNum, vec3_t const * const change, uint32_t cliptype) { return A_MoveSpriteClipdist(spriteNum, change, cliptype, -1); diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 831ca4524..335f57c05 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -415,7 +415,7 @@ void A_GetZLimits(int const spriteNum) { actor[spriteNum].flags |= SFLAG_NOFLOORSHADOW; // No shadows on actors pSprite->xvel = -256; // SLIDE_ABOVE_ENEMY - A_SetSprite(spriteNum, CLIPMASK0); + A_SetSpriteNoZ(spriteNum, CLIPMASK0); } else if (pSprite->statnum == STAT_PROJECTILE && hitspr->picnum == APLAYER && pSprite->owner==florhit) {