mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- Miscellaneous fixes to commit to change sector checks over to validSectorIndex()
.
* Fix missed changeover in Blood's `actSpawnSprite()`. * Fix non-negated check on a `validSectorIndex()` call in Blood's `debrisMove()`. * Removed a superfluous terminator in Duke's `actor.cpp`. * Fixed bad call to `validSectorIndex()` in Exhumed's `AIAnim::Tick()`.
This commit is contained in:
parent
999ec3c95a
commit
c6f2aaf1b7
4 changed files with 4 additions and 10 deletions
|
@ -6402,7 +6402,7 @@ DBloodActor* actSpawnSprite(DBloodActor* source, int nStat)
|
||||||
BloodStatIterator it(kStatPurge);
|
BloodStatIterator it(kStatPurge);
|
||||||
actor = it.Next();
|
actor = it.Next();
|
||||||
assert(actor);
|
assert(actor);
|
||||||
assert(pSource->sectnum >= 0 && pSource->sectnum < kMaxSectors);
|
assert(validSectorIndex(pSource->sectnum));
|
||||||
ChangeActorSect(actor, pSource->sectnum);
|
ChangeActorSect(actor, pSource->sectnum);
|
||||||
actPostSprite(actor, nStat);
|
actPostSprite(actor, nStat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1692,17 +1692,11 @@ void debrisMove(int listIndex)
|
||||||
spritetype* pSprite = &actor->s();
|
spritetype* pSprite = &actor->s();
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
|
|
||||||
if (!actor->hasX())
|
if (!actor->hasX() || !validSectorIndex(pSprite->sectnum))
|
||||||
{
|
{
|
||||||
gPhysSpritesList[listIndex] = nullptr;
|
gPhysSpritesList[listIndex] = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (validSectorIndex(pSprite->sectnum))
|
|
||||||
{
|
|
||||||
gPhysSpritesList[listIndex] = nullptr;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int top, bottom, i;
|
int top, bottom, i;
|
||||||
GetActorExtents(actor, &top, &bottom);
|
GetActorExtents(actor, &top, &bottom);
|
||||||
|
|
|
@ -2255,7 +2255,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
|
||||||
if (callsetsprite) setsprite(actor, s->pos);
|
if (callsetsprite) setsprite(actor, s->pos);
|
||||||
|
|
||||||
// this was after the slope calls, but we should avoid calling that for invalid sectors.
|
// this was after the slope calls, but we should avoid calling that for invalid sectors.
|
||||||
if (!validSectorIndex(s->sectnum));
|
if (!validSectorIndex(s->sectnum))
|
||||||
{
|
{
|
||||||
deletesprite(actor);
|
deletesprite(actor);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -149,7 +149,7 @@ void AIAnim::Tick(RunListEvent* ev)
|
||||||
|
|
||||||
if (pSpriteB->sectnum != pSprite->sectnum)
|
if (pSpriteB->sectnum != pSprite->sectnum)
|
||||||
{
|
{
|
||||||
if (!validSectorIndex(pSpriteB))
|
if (!validSectorIndex(pSpriteB->sectnum))
|
||||||
{
|
{
|
||||||
DestroyAnim(pActor);
|
DestroyAnim(pActor);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue