🎨 Leverage 'IsAnyOf' on monster mode checks
This commit is contained in:
parent
1cd62bbc64
commit
fe95e36d90
3 changed files with 4 additions and 6 deletions
|
|
@ -1342,7 +1342,7 @@ void AddBerserk(MissileStruct &missile, Point dst, Direction /*midir*/)
|
|||
|
||||
if (monster._uniqtype != 0 || monster._mAi == AI_DIABLO)
|
||||
continue;
|
||||
if (monster._mmode == MonsterMode::FadeIn || monster._mmode == MonsterMode::FadeOut)
|
||||
if (IsAnyOf(monster._mmode, MonsterMode::FadeIn, MonsterMode::FadeOut))
|
||||
continue;
|
||||
if ((monster.mMagicRes & IMMUNE_MAGIC) != 0)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -4187,9 +4187,7 @@ void GolumAi(int i)
|
|||
return;
|
||||
}
|
||||
|
||||
if (golem._mmode == MonsterMode::Death
|
||||
|| golem._mmode == MonsterMode::SpecialStand
|
||||
|| golem.IsWalking()) {
|
||||
if (IsAnyOf(golem._mmode, MonsterMode::Death, MonsterMode::SpecialStand) || golem.IsWalking()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -5006,7 +5004,7 @@ void decode_enemy(MonsterStruct &monster, int enemy)
|
|||
|
||||
void MonsterStruct::CheckStandAnimationIsLoaded(Direction mdir)
|
||||
{
|
||||
if (_mmode == MonsterMode::Stand || _mmode == MonsterMode::Talk) {
|
||||
if (IsAnyOf(_mmode, MonsterMode::Stand, MonsterMode::Talk)) {
|
||||
_mdir = mdir;
|
||||
AnimInfo.pCelSprite = &*MType->GetAnimData(MonsterGraphic::Stand).CelSpritesForDirections[mdir];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ void SyncMonster(int pnum, const TSyncMonster *p)
|
|||
if (monster.position.future.x == p->_mx && monster.position.future.y == p->_my) {
|
||||
return;
|
||||
}
|
||||
if (monster._mmode == MonsterMode::Charge || monster._mmode == MonsterMode::Petrified) {
|
||||
if (IsAnyOf(monster._mmode, MonsterMode::Charge, MonsterMode::Petrified)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue