Tidy anims.cpp somewhat

This commit is contained in:
sirlemonhead 2019-11-30 16:04:59 +00:00 committed by Christoph Oelckers
parent a7e09febe4
commit eecb503207

View file

@ -165,16 +165,16 @@ void FuncAnim(int a, int, int nRun)
if (sprite[nSprite].statnum == kStatIgnited) if (sprite[nSprite].statnum == kStatIgnited)
{ {
short nHitag = sprite[nSprite].hitag; short nSpriteB = sprite[nSprite].hitag;
if (nHitag > -1) if (nSpriteB > -1)
{ {
sprite[nSprite].x = sprite[nHitag].x; sprite[nSprite].x = sprite[nSpriteB].x;
sprite[nSprite].y = sprite[nHitag].y; sprite[nSprite].y = sprite[nSpriteB].y;
sprite[nSprite].z = sprite[nHitag].z; sprite[nSprite].z = sprite[nSpriteB].z;
if (sprite[nHitag].sectnum != sprite[nSprite].sectnum) if (sprite[nSpriteB].sectnum != sprite[nSprite].sectnum)
{ {
if (sprite[nHitag].sectnum < 0 || sprite[nHitag].sectnum >= kMaxSectors) if (sprite[nSpriteB].sectnum < 0 || sprite[nSpriteB].sectnum >= kMaxSectors)
{ {
DestroyAnim(nAnim); DestroyAnim(nAnim);
mydeletesprite(nSprite); mydeletesprite(nSprite);
@ -182,47 +182,51 @@ void FuncAnim(int a, int, int nRun)
} }
else else
{ {
mychangespritesect(nSprite, sprite[nHitag].sectnum); mychangespritesect(nSprite, sprite[nSpriteB].sectnum);
} }
} }
if (!var_1C) if (!var_1C)
{ {
if (sprite[nHitag].cstat != 0x8000) if (sprite[nSpriteB].cstat != 0x8000)
{ {
short hitag2 = sprite[nHitag].hitag; short hitag2 = sprite[nSpriteB].hitag;
sprite[nHitag].hitag--; sprite[nSpriteB].hitag--;
if (hitag2 >= 15) if (hitag2 >= 15)
{ {
runlist_DamageEnemy(nHitag, -1, (sprite[nHitag].hitag - 14) * 2); runlist_DamageEnemy(nSpriteB, -1, (sprite[nSpriteB].hitag - 14) * 2);
if (sprite[nHitag].shade < 100)
if (sprite[nSpriteB].shade < 100)
{ {
sprite[nHitag].pal = 0; sprite[nSpriteB].pal = 0;
sprite[nHitag].shade++; sprite[nSpriteB].shade++;
} }
if (!(sprite[nHitag].cstat & 101)) if (!(sprite[nSpriteB].cstat & 101))
{ {
DestroyAnim(nAnim); DestroyAnim(nAnim);
mydeletesprite(nSprite); mydeletesprite(nSprite);
return; return;
} }
}
goto loc_2D755; else
{
sprite[nSpriteB].hitag = 1;
DestroyAnim(nAnim);
mydeletesprite(nSprite);
} }
} }
else
sprite[nHitag].hitag = 1; {
DestroyAnim(nAnim); sprite[nSpriteB].hitag = 1;
mydeletesprite(nSprite); DestroyAnim(nAnim);
mydeletesprite(nSprite);
}
} }
} }
} }
// loc_2D755
loc_2D755:
AnimList[nAnim].field_2++; AnimList[nAnim].field_2++;
if (AnimList[nAnim].field_2 >= SeqSize[nSeq]) if (AnimList[nAnim].field_2 >= SeqSize[nSeq])
{ {