mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-26 08:50:55 +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);
|
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
||||||
int nSprite = xsprite[nXSprite].reference;
|
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];
|
spritetype* pSprite = &sprite[nSprite];
|
||||||
assert(pSprite->extra == nXSprite);
|
assert(pSprite->extra == nXSprite);
|
||||||
if (pSprite->flags & 2)
|
if (pSprite->flags & 2)
|
||||||
|
@ -657,12 +658,14 @@ void seqProcess(int nTicks)
|
||||||
{
|
{
|
||||||
if (pInst->type == SS_SPRITE)
|
if (pInst->type == SS_SPRITE)
|
||||||
{
|
{
|
||||||
short nSprite = (short)xsprite[index].reference;
|
int nSprite = xsprite[index].reference;
|
||||||
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
if (nSprite >= 0 && nSprite < kMaxSprites)
|
||||||
evKill(nSprite, SS_SPRITE);
|
{
|
||||||
if ((sprite[nSprite].hitag & kAttrRespawn) != 0 && (sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax))
|
evKill(nSprite, SS_SPRITE);
|
||||||
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
if ((sprite[nSprite].hitag & kAttrRespawn) != 0 && (sprite[nSprite].inittype >= kDudeBase && sprite[nSprite].inittype < kDudeMax))
|
||||||
else deletesprite(nSprite); // safe to not use actPostSprite here
|
evPost(nSprite, 3, gGameOptions.nMonsterRespawnTime, kCallbackRespawn);
|
||||||
|
else deletesprite(nSprite); // safe to not use actPostSprite here
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInst->type == SS_MASKED)
|
if (pInst->type == SS_MASKED)
|
||||||
|
|
Loading…
Reference in a new issue