mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
Fix an OG Duke bug where projectiles would bounce off the tops of sprites instead of registering a hit
git-svn-id: https://svn.eduke32.com/eduke32@7794 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
12ce6a78fe
commit
df609ccfbc
1 changed files with 9 additions and 6 deletions
|
@ -379,7 +379,8 @@ int A_CheckNoSE7Water(uspriteptr_t const pSprite, int sectNum, int sectLotag, in
|
||||||
// 1 if yes, but stayed inside [actor[].ceilingz+1, actor[].floorz].
|
// 1 if yes, but stayed inside [actor[].ceilingz+1, actor[].floorz].
|
||||||
// <0 if yes, but passed a TROR no-SE7 water boundary. -returnvalue-1 is the
|
// <0 if yes, but passed a TROR no-SE7 water boundary. -returnvalue-1 is the
|
||||||
// other-side sector number.
|
// other-side sector number.
|
||||||
static int32_t A_CheckNeedZUpdate(int32_t spriteNum, int32_t zChange, int32_t *pZcoord)
|
static int32_t A_CheckNeedZUpdate(int32_t spriteNum, int32_t zChange, int32_t *pZcoord,
|
||||||
|
int32_t *ceilhit, int32_t *florhit)
|
||||||
{
|
{
|
||||||
if (zChange == 0)
|
if (zChange == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -389,10 +390,9 @@ static int32_t A_CheckNeedZUpdate(int32_t spriteNum, int32_t zChange, int32_t *p
|
||||||
|
|
||||||
*pZcoord = newZ;
|
*pZcoord = newZ;
|
||||||
|
|
||||||
int32_t ceilhit, florhit;
|
|
||||||
int const clipDist = A_GetClipdist(spriteNum, -1);
|
int const clipDist = A_GetClipdist(spriteNum, -1);
|
||||||
|
|
||||||
VM_GetZRange(spriteNum, &ceilhit, &florhit, pSprite->statnum == STAT_PROJECTILE ? clipDist << 3 : clipDist);
|
VM_GetZRange(spriteNum, ceilhit, florhit, pSprite->statnum == STAT_PROJECTILE ? clipDist << 3 : clipDist);
|
||||||
|
|
||||||
if (newZ > actor[spriteNum].ceilingz && newZ <= actor[spriteNum].floorz)
|
if (newZ > actor[spriteNum].ceilingz && newZ <= actor[spriteNum].floorz)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -419,7 +419,7 @@ static int32_t A_CheckNeedZUpdate(int32_t spriteNum, int32_t zChange, int32_t *p
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int A_GetClipdist(int spriteNum, int clipDist)
|
int A_GetClipdist(int spriteNum, int clipDist)
|
||||||
|
@ -558,10 +558,13 @@ int32_t A_MoveSpriteClipdist(int32_t spriteNum, vec3_t const * const change, uin
|
||||||
|
|
||||||
Bassert(newSectnum == pSprite->sectnum);
|
Bassert(newSectnum == pSprite->sectnum);
|
||||||
|
|
||||||
int const doZUpdate = change->z ? A_CheckNeedZUpdate(spriteNum, change->z, &newZ) : 0;
|
int32_t ceilhit, florhit;
|
||||||
|
int const doZUpdate = change->z ? A_CheckNeedZUpdate(spriteNum, change->z, &newZ, &ceilhit, &florhit) : 0;
|
||||||
|
|
||||||
// Update sprite's z positions and (for TROR) maybe the sector number.
|
// Update sprite's z positions and (for TROR) maybe the sector number.
|
||||||
if (doZUpdate)
|
if (doZUpdate == 2)
|
||||||
|
returnValue = change->z < 0 ? ceilhit : florhit;
|
||||||
|
else if (doZUpdate)
|
||||||
{
|
{
|
||||||
pSprite->z = newZ;
|
pSprite->z = newZ;
|
||||||
#ifdef YAX_ENABLE
|
#ifdef YAX_ENABLE
|
||||||
|
|
Loading…
Reference in a new issue