diff --git a/source/build/include/build.h b/source/build/include/build.h index 001e58a96..a221e3844 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -530,10 +530,6 @@ inline int32_t setsprite(int16_t spritenum, int x, int y, int z) 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 spriteheightofsptr(uspriteptr_t spr, int32_t *height, int32_t alsotileyofs); diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 5d48b5bf7..0ea687699 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -880,7 +880,7 @@ int32_t setsprite(int16_t spritenum, const vec3_t *newpos) { int16_t tempsectnum = sprite[spritenum].sectnum; - if ((void const *) newpos != (void *) &sprite[spritenum]) + if (newpos != &sprite[spritenum].pos) sprite[spritenum].pos = *newpos; updatesector(newpos->x,newpos->y,&tempsectnum); diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 72d9980a0..b9cabe433 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -173,7 +173,7 @@ void checkavailweapon(struct player_struct* player) player->curr_weapon = weap; if (isWW2GI()) { - SetGameVarID(g_iWeaponVarID, player->curr_weapon, player->GetActor(), snum); // snum is playerindex! + SetGameVarID(g_iWeaponVarID, player->curr_weapon, player->GetActor(), snum); // snum is player index! if (player->curr_weapon >= 0) { SetGameVarID(g_iWorksLikeVarID, aplWeaponWorksLike[player->curr_weapon][snum], player->GetActor(), snum); @@ -1010,7 +1010,7 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2) // 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->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; int x = s->x, y = s->y, z = s->z; 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) changespritesect(actor, j);