Browse Source

UpdateEnemy: Swap the M_Talker check

The `otherMonster.talkMsg != TEXT_NONE` check is a lot cheaper and is
almost always false.

This eliminates the M_Talker cost from the debug profile.
pull/5610/head
Gleb Mazovetskiy 3 years ago committed by Anders Jenbo
parent
commit
3910c2e56a
  1. 2
      Source/monster.cpp

2
Source/monster.cpp

@ -642,7 +642,7 @@ void UpdateEnemy(Monster &monster)
continue;
if (otherMonster.position.tile == GolemHoldingCell)
continue;
if (M_Talker(otherMonster) && otherMonster.talkMsg != TEXT_NONE)
if (otherMonster.talkMsg != TEXT_NONE && M_Talker(otherMonster))
continue;
if (monster.isPlayerMinion() && otherMonster.isPlayerMinion()) // prevent golems from fighting each other
continue;

Loading…
Cancel
Save