mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-22 11:41:08 +00:00
- converted FuncCreatureChunk into a class.
This commit is contained in:
parent
b772200dd4
commit
008825fe32
2 changed files with 15 additions and 6 deletions
|
@ -500,6 +500,11 @@ struct AILion : public ExhumedAI
|
||||||
void RadialDamage(RunListEvent* ev) override;
|
void RadialDamage(RunListEvent* ev) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct AICreatureChunk : public ExhumedAI
|
||||||
|
{
|
||||||
|
virtual void Tick(RunListEvent* ev) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
void runlist_DispatchEvent(ExhumedAI* ai, int nObject, int nMessage, int nDamage, int nRun);
|
void runlist_DispatchEvent(ExhumedAI* ai, int nObject, int nMessage, int nDamage, int nRun);
|
||||||
|
|
||||||
|
|
|
@ -1491,15 +1491,12 @@ int BuildCreatureChunk(int nVal, int nPic)
|
||||||
return nSprite | 0xD0000;
|
return nSprite | 0xD0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FuncCreatureChunk(int nObject, int nMessage, int, int nRun)
|
void AICreatureChunk::Tick(RunListEvent* ev)
|
||||||
{
|
{
|
||||||
int nSprite = RunData[nRun].nVal;
|
int nSprite = RunData[ev->nRun].nVal;
|
||||||
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
||||||
auto pSprite = &sprite[nSprite];
|
auto pSprite = &sprite[nSprite];
|
||||||
|
|
||||||
if (nMessage != 0x20000)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Gravity(nSprite);
|
Gravity(nSprite);
|
||||||
|
|
||||||
int nSector = pSprite->sectnum;
|
int nSector = pSprite->sectnum;
|
||||||
|
@ -1569,6 +1566,13 @@ void FuncCreatureChunk(int nObject, int nMessage, int, int nRun)
|
||||||
pSprite->lotag = 0;
|
pSprite->lotag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FuncCreatureChunk(int nObject, int nMessage, int nDamage, int nRun)
|
||||||
|
{
|
||||||
|
AICreatureChunk ai;
|
||||||
|
runlist_DispatchEvent(&ai, nObject, nMessage, nDamage, nRun);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
short UpdateEnemy(short *nEnemy)
|
short UpdateEnemy(short *nEnemy)
|
||||||
{
|
{
|
||||||
if (*nEnemy >= 0)
|
if (*nEnemy >= 0)
|
||||||
|
|
Loading…
Reference in a new issue