mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
- Blood: added checks to the SEQ code to handle situation where their attached object has been removed from the game.
This commit is contained in:
parent
62502439d7
commit
d4439b879c
1 changed files with 10 additions and 7 deletions
|
@ -260,7 +260,8 @@ void UpdateSprite(int nXSprite, SEQFRAME* pFrame)
|
|||
{
|
||||
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||
int nSprite = xsprite[nXSprite].reference;
|
||||
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||
if (!(nSprite >= 0 && nSprite < kMaxSprites)) return; // sprite may have been deleted already.
|
||||
|
||||
spritetype* pSprite = &sprite[nSprite];
|
||||
assert(pSprite->extra == nXSprite);
|
||||
if (pSprite->flags & 2)
|
||||
|
@ -657,12 +658,14 @@ void seqProcess(int nTicks)
|
|||
{
|
||||
if (pInst->type == SS_SPRITE)
|
||||
{
|
||||
short nSprite = (short)xsprite[index].reference;
|
||||
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||
evKill(nSprite, SS_SPRITE);
|
||||
if ((sprite[nSprite].hitag & kAttrRespawn) != 0 && (sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax))
|
||||
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
||||
else deletesprite(nSprite); // safe to not use actPostSprite here
|
||||
int nSprite = xsprite[index].reference;
|
||||
if (nSprite >= 0 && nSprite < kMaxSprites)
|
||||
{
|
||||
evKill(nSprite, SS_SPRITE);
|
||||
if ((sprite[nSprite].hitag & kAttrRespawn) != 0 && (sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax))
|
||||
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
||||
else deletesprite(nSprite); // safe to not use actPostSprite here
|
||||
}
|
||||
}
|
||||
|
||||
if (pInst->type == SS_MASKED)
|
||||
|
|
Loading…
Reference in a new issue