Fix CheckFlee logic

This /should/ be correct. But it doesn't explain other issues we've seen
on some servers
This commit is contained in:
Michael Cook (mackal) 2020-01-03 15:49:20 -05:00
parent 40595de46b
commit a94072e3ea

View File

@ -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();
}