- clean up some loops

This commit is contained in:
Christoph Oelckers 2021-08-28 14:14:18 +02:00
parent 9714febaab
commit c59a6bbb86
2 changed files with 7 additions and 5 deletions

View file

@ -2610,7 +2610,7 @@ void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
gKillMgr.AddKill(pSprite);
pSprite->type = kThingBloodChunks;
actPostSprite(pSprite->index, kStatThing);
actPostSprite(actor, kStatThing);
}
//---------------------------------------------------------------------------

View file

@ -548,7 +548,7 @@ void nnExtInitModernStuff(bool bSaveLoad)
for (int i = 0; i < kMaxXSprites; i++)
{
auto actor = &bloodActors[i];
if (!actor->hasX()) continue;
if (actor->s().statnum == kStatFree || !actor->hasX()) continue;
XSPRITE* pXSprite = &actor->x();
spritetype* pSprite = &actor->s();
@ -578,7 +578,7 @@ void nnExtInitModernStuff(bool bSaveLoad)
// add in list of physics affected sprites
if (pXSprite->physAttr != 0)
{
gPhysSpritesList[gPhysSpritesCount++] = &bloodActors[pSprite->index]; // add sprite index
gPhysSpritesList[gPhysSpritesCount++] = actor; // add sprite index
getSpriteMassBySize(actor); // create mass cache
}
@ -859,10 +859,12 @@ void nnExtInitModernStuff(bool bSaveLoad)
for (int i = 0; i < kMaxXSprites; i++)
{
if (!spriRangeIsFine(xsprite[i].reference) || xsprite[i].txID != pXSprite->rxID || xsprite[i].reference == pSprite->index)
auto actor = &bloodActors[i];
if (actor->s().statnum == kStatFree || !actor->hasX() || xsprite[i].txID != pXSprite->rxID || actor == iactor)
continue;
XSPRITE* pXSpr = &xsprite[i]; spritetype* pSpr = &sprite[pXSpr->reference];
XSPRITE* pXSpr = &actor->x();
spritetype* pSpr = &actor->s();
int index = pXSpr->reference; int cmd = pXSpr->command;
switch (pSpr->type) {
case kSwitchToggle: // exceptions