mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-31 04:20:42 +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;
|
||||
};
|
||||
|
||||
struct AICreatureChunk : public ExhumedAI
|
||||
{
|
||||
virtual void Tick(RunListEvent* ev) override;
|
||||
};
|
||||
|
||||
|
||||
void runlist_DispatchEvent(ExhumedAI* ai, int nObject, int nMessage, int nDamage, int nRun);
|
||||
|
||||
|
|
|
@ -1491,14 +1491,11 @@ int BuildCreatureChunk(int nVal, int nPic)
|
|||
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);
|
||||
auto pSprite = &sprite[nSprite];
|
||||
|
||||
if (nMessage != 0x20000)
|
||||
return;
|
||||
auto pSprite = &sprite[nSprite];
|
||||
|
||||
Gravity(nSprite);
|
||||
|
||||
|
@ -1569,6 +1566,13 @@ void FuncCreatureChunk(int nObject, int nMessage, int, int nRun)
|
|||
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)
|
||||
{
|
||||
if (*nEnemy >= 0)
|
||||
|
|
Loading…
Reference in a new issue