From a94072e3ea1e1b7f05846c06b16cf7dde71a203e Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 3 Jan 2020 15:49:20 -0500 Subject: [PATCH] Fix CheckFlee logic This /should/ be correct. But it doesn't explain other issues we've seen on some servers --- zone/fearpath.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 3f14b059a..615d3adc0 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -108,8 +108,12 @@ void Mob::CheckFlee() { } // If we got here we are allowed to roll on flee chance if there is not other hated NPC's in the area. - - if(RuleB(Combat, FleeIfNotAlone) || GetSpecialAbility(ALWAYS_FLEE) || zone->random.Roll(flee_chance) && entity_list.GetHatedCount(hate_top, this, true) == 0) { + // ALWAYS_FLEE, skip roll + // if FleeIfNotAlone is true, we skip alone check + // roll chance + if (GetSpecialAbility(ALWAYS_FLEE) || + ((RuleB(Combat, FleeIfNotAlone) || entity_list.GetHatedCount(hate_top, this, true) == 0) && + zone->random.Roll(flee_chance))) { currently_fleeing = true; StartFleeing(); }