From 3910c2e56ad947766a4d85f2cecb8147489b2410 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Fri, 16 Dec 2022 08:39:10 +0000 Subject: [PATCH] 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. --- Source/monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 2224e3e27..53abb0d3e 100644 --- a/Source/monster.cpp +++ b/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;