From 5b38343407e433e94cfe68b6b4734819dc1a96a3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 9 Jun 2021 00:31:18 +0200 Subject: [PATCH] - fixed sprite exclusion logic in getzrange. This was using the wrong flag. --- source/build/src/clip.cpp | 2 +- source/games/duke/src/actors.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 2 +- source/games/duke/src/namelist_r.h | 2 +- source/games/duke/src/player_r.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index df5ea421eeb..11a4946ac18 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -1081,7 +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 & CSTAT_SPRITE_NOFIND) continue; if (cstat&dasprclipmask) { int32_t clipyou = 0; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index ae7d35b6c4f..72d9980a02e 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -4956,7 +4956,7 @@ void getglobalz(DDukeActor* actor) 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. + s->cstat |= CSTAT_SPRITE_NOFIND; // 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; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index 2b0d4be5ebb..4832c784381 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -815,7 +815,7 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int break; case UFOBEAM: case RRTILE3586: - case RRTILE3587: + case LADDER: t->cstat |= 32768; s->cstat |= 32768; break; diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index ecc5e6a5d77..8e767440686 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -933,7 +933,7 @@ y(RRTILE3500, 3500) x(SLINGBLADE, 3510) y(RRTILE3584, 3584) y(RRTILE3586, 3586) -y(RRTILE3587, 3587) +y(LADDER, 3587) y(RRTILE3600, 3600) y(RRTILE3631, 3631) y(RRTILE3635, 3635) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index cc22cf2e3c6..2a289474ed5 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3426,7 +3426,7 @@ void processinput_r(int snum) chz.actor = nullptr; cz = p->truecz; } - else if (chz.actor->s->picnum == RRTILE3587) + else if (chz.actor->s->picnum == LADDER) { if (!p->stairs) { @@ -3473,7 +3473,7 @@ void processinput_r(int snum) p->posxv -= bcos(j, 4); p->posyv -= bsin(j, 4); } - if (clz.actor->s->picnum == RRTILE3587) + if (clz.actor->s->picnum == LADDER) { if (!p->stairs) {