[Pathing] Smoother pathing z-correction (#2982)

This commit is contained in:
Chris Miles 2023-02-24 14:07:44 -06:00 committed by GitHub
parent 889e57a5af
commit e8f1aa253a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -319,7 +319,6 @@ RULE_CATEGORY_END()
RULE_CATEGORY(Map)
RULE_BOOL(Map, FixPathingZOnSendTo, false, "Try to repair Z coordinates in the SendTo routine as well")
RULE_BOOL(Map, FixZWhenPathing, true, "Automatically fix NPC Z coordinates when moving/pathing/engaged (Far less CPU intensive than its predecessor)")
RULE_REAL(Map, DistanceCanTravelBeforeAdjustment, 10.0, "Distance a mob can path before FixZ is called, depends on FixZWhenPathing")
RULE_BOOL(Map, MobZVisualDebug, false, "Displays spell effects determining whether or not NPC is hitting Best Z calcs (blue for hit, red for miss)")
RULE_BOOL(Map, MobPathingVisualDebug, false, "Displays nodes in pathing points in realtime to help with visual debugging")
RULE_REAL(Map, FixPathingZMaxDeltaSendTo, 20, "At runtime in SendTo: maximum change in Z to allow the BestZ code to apply")

View File

@ -236,7 +236,7 @@ public:
if (RuleB(Map, FixZWhenPathing)) {
m_distance_moved_since_correction += distance_moved;
if (m_distance_moved_since_correction > RuleR(Map, DistanceCanTravelBeforeAdjustment)) {
if (m_distance_moved_since_correction > (mob->IsEngaged() ? 1 : 10)) {
m_distance_moved_since_correction = 0.0;
mob->FixZ();
}