Add check in distance calculations to stay at range if set even if no ammo or ranged

This commit is contained in:
nytmyr
2025-01-24 11:01:39 -06:00
parent e1925d1b13
commit 9134516847
+1
View File
@@ -3180,6 +3180,7 @@ void Bot::CalcMeleeDistances(const Mob* tar, const EQ::ItemInstance* const& p_it
float min_distance = RuleI(Combat, MinRangedAttackDist);
float max_distance = GetBotRangedValue();
float desired_range = GetBotDistanceRanged();
max_distance = (max_distance == 0 ? desired_range : max_distance); // stay ranged if set to ranged even if items/ammo aren't correct
melee_distance_min = std::max(min_distance, (desired_range / 2));
melee_distance = std::min(max_distance, desired_range);
}