mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- use a wrapper function to check for the radial damage event.
This commit is contained in:
parent
7a65cc46d0
commit
791240786d
5 changed files with 7 additions and 5 deletions
|
@ -399,6 +399,8 @@ struct RunListEvent
|
|||
int nRadialDamage; // Radial damage needs a bit more info.
|
||||
int nDamageRadius;
|
||||
DExhumedActor* pRadialActor;
|
||||
|
||||
bool isRadialEvent() const { return nMessage == EMessageType::RadialDamage; }
|
||||
};
|
||||
|
||||
struct ExhumedAI
|
||||
|
|
|
@ -440,7 +440,7 @@ void AIAnubis::Damage(RunListEvent* ev)
|
|||
if (nAction < 11)
|
||||
{
|
||||
DropMagic(ap);
|
||||
ap->nAction = (ev->nMessage == EMessageType::RadialDamage) + 11;
|
||||
ap->nAction = int(ev->isRadialEvent()) + 11;
|
||||
ap->nFrame = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,7 +287,7 @@ void AIFish::Damage(RunListEvent* ev)
|
|||
|
||||
pSprite->cstat &= 0xFEFE;
|
||||
|
||||
if (ev->nMessage == EMessageType::Damage)
|
||||
if (!ev->isRadialEvent())
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ void AILion::Damage(RunListEvent* ev)
|
|||
{
|
||||
DropMagic(pActor);
|
||||
|
||||
if (ev->nMessage == EMessageType::RadialDamage)
|
||||
if (ev->isRadialEvent())
|
||||
{
|
||||
pActor->nAction = 11;
|
||||
}
|
||||
|
|
|
@ -650,7 +650,7 @@ void AIPlayer::Damage(RunListEvent* ev)
|
|||
return;
|
||||
}
|
||||
|
||||
DExhumedActor* pActor2 = (ev->nMessage != EMessageType::RadialDamage) ? ev->pOtherActor : ev->pRadialActor->pTarget;
|
||||
DExhumedActor* pActor2 = (!ev->isRadialEvent()) ? ev->pOtherActor : ev->pRadialActor->pTarget;
|
||||
|
||||
// ok continue case 0x80000 as normal, loc_1C57C
|
||||
if (!PlayerList[nPlayer].nHealth) {
|
||||
|
@ -726,7 +726,7 @@ void AIPlayer::Damage(RunListEvent* ev)
|
|||
PlayerList[nPlayer].nPlayerScore--;
|
||||
}
|
||||
|
||||
if (ev->nMessage == EMessageType::RadialDamage)
|
||||
if (ev->isRadialEvent())
|
||||
{
|
||||
for (int i = 122; i <= 131; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue