mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- When keeping around a dummy sprite, make sure that the engine's utilities cannot find it anymore.
This was causing issues with the master switch sprites in Duke that have to be kept for sound purposes. Unfortunately, both hitscan and neartag are far too dumb to analyze sprites they may hit in any way and needed some help skipping such sprites.
This commit is contained in:
parent
962e313eb2
commit
42b87362ee
4 changed files with 8 additions and 1 deletions
|
@ -152,6 +152,7 @@ enum
|
|||
|
||||
// Raze extensions, using the higher bits to avoid conflitcs with the reserved and undocumented bits above.
|
||||
CSTAT_SPRITE_MDLROTATE = 1u<<16u, // Only for tsprites: rotate if this is a model or voxel.
|
||||
CSTAT_SPRITE_NOFIND = 1u<<17u, // Invisible to neartag and hitscan
|
||||
|
||||
};
|
||||
enum
|
||||
|
|
|
@ -1428,6 +1428,10 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32
|
|||
{
|
||||
auto const spr = (uspriteptr_t)&sprite[z];
|
||||
uint32_t const cstat = spr->cstat;
|
||||
|
||||
if (cstat & CSTAT_SPRITE_NOFIND)
|
||||
continue;
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (!hitallsprites)
|
||||
#endif
|
||||
|
|
|
@ -2360,6 +2360,8 @@ void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange,
|
|||
{
|
||||
auto const spr = (uspriteptr_t)&sprite[z];
|
||||
|
||||
if (spr->cstat & CSTAT_SPRITE_NOFIND)
|
||||
continue;
|
||||
if (blacklist_sprite_func && blacklist_sprite_func(z))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -1014,7 +1014,7 @@ void movemasterswitch(DDukeActor *actor, int spectype1, int spectype2)
|
|||
// This originally depended on undefined behavior as the deleted sprite was still used for the sound
|
||||
// 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;
|
||||
spri->cstat |= CSTAT_SPRITE_INVISIBLE|CSTAT_SPRITE_NOFIND;
|
||||
changespritestat(actor->GetIndex(), STAT_REMOVED);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue