- cleaned up some dirty code.

This commit is contained in:
Christoph Oelckers 2021-08-30 08:07:40 +02:00
parent 07eda3cb4a
commit 0bd0923f44
3 changed files with 4 additions and 8 deletions

View file

@ -530,10 +530,6 @@ inline int32_t setsprite(int16_t spritenum, int x, int y, int z)
return setsprite(spritenum, &v); return setsprite(spritenum, &v);
} }
inline void setspritepos(int spnum, int x, int y, int z)
{
sprite[spnum].pos = { x,y,z };
}
int32_t setspritez(int16_t spritenum, const vec3_t *) ATTRIBUTE((nonnull(2))); int32_t setspritez(int16_t spritenum, const vec3_t *) ATTRIBUTE((nonnull(2)));
int32_t spriteheightofsptr(uspriteptr_t spr, int32_t *height, int32_t alsotileyofs); int32_t spriteheightofsptr(uspriteptr_t spr, int32_t *height, int32_t alsotileyofs);

View file

@ -880,7 +880,7 @@ int32_t setsprite(int16_t spritenum, const vec3_t *newpos)
{ {
int16_t tempsectnum = sprite[spritenum].sectnum; int16_t tempsectnum = sprite[spritenum].sectnum;
if ((void const *) newpos != (void *) &sprite[spritenum]) if (newpos != &sprite[spritenum].pos)
sprite[spritenum].pos = *newpos; sprite[spritenum].pos = *newpos;
updatesector(newpos->x,newpos->y,&tempsectnum); updatesector(newpos->x,newpos->y,&tempsectnum);

View file

@ -1010,7 +1010,7 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2)
// with no checking if it got reused in the mean time. // with no checking if it got reused in the mean time.
spri->picnum = 0; // give it a picnum without any behavior attached, just in case spri->picnum = 0; // give it a picnum without any behavior attached, just in case
spri->cstat |= CSTAT_SPRITE_INVISIBLE|CSTAT_SPRITE_NOFIND; spri->cstat |= CSTAT_SPRITE_INVISIBLE|CSTAT_SPRITE_NOFIND;
changespritestat(actor->GetIndex(), STAT_REMOVED); changespritestat(actor, STAT_REMOVED);
} }
} }
} }
@ -5316,7 +5316,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
short j = s->sectnum; short j = s->sectnum;
int x = s->x, y = s->y, z = s->z; int x = s->x, y = s->y, z = s->z;
pushmove(&x, &y, &z, &j, 128, (4 << 8), (4 << 8), CLIPMASK0); pushmove(&x, &y, &z, &j, 128, (4 << 8), (4 << 8), CLIPMASK0);
setspritepos(actor->GetIndex(), x, y, z); // wrap this for safety. The renderer may need processing of the new position. s->x = x; s->y = y; s->z = z;
if (j != s->sectnum && j >= 0 && j < MAXSECTORS) if (j != s->sectnum && j >= 0 && j < MAXSECTORS)
changespritesect(actor, j); changespritesect(actor, j);