- Duke: avoid clipping against self when executing script logic for floor sprites.

A good place to see the result is a kitchen knife in E4L2 that went missing due to the faulty check.
This commit is contained in:
Christoph Oelckers 2021-06-01 21:21:39 +02:00
parent f0d2aef9d9
commit dc846dcd49
2 changed files with 4 additions and 0 deletions

View file

@ -1081,6 +1081,7 @@ void getzrange(const vec3_t *pos, int16_t sectnum,
const int32_t cstat = sprite[j].cstat;
int32_t daz, daz2;
if (cstat & CSTAT_SPRITE_INVISIBLE) continue;
if (cstat&dasprclipmask)
{
int32_t clipyou = 0;

View file

@ -4955,7 +4955,10 @@ void getglobalz(DDukeActor* actor)
zr = 4;
else zr = 127;
auto cc = s->cstat;
s->cstat |= CSTAT_SPRITE_INVISIBLE; // don't clip against self. getzrange cannot detect this because it only receives a coordinate.
getzrange_ex(s->x, s->y, s->z - (FOURSLEIGHT), s->sectnum, &actor->ceilingz, hz, &actor->floorz, lz, zr, CLIPMASK0);
s->cstat = cc;
if( lz.type == kHitSprite && (lz.actor->s->cstat&48) == 0 )
{