Changeset 25150

Timestamp:
Mar 28, 2021, 3:12:51 PM (3 years ago)
Author:
wraitii
Message:

Fix degenerate case in UnitMotion resulting in lag.

rP24708 introduced logic to extend the search range of the short pathfinder in some situations. This extension was unbounded, resulting occasionally in search domains several hundred meters wide, and path computation that can take several seconds.

Reported by: Vico (on the forums).

Differential Revision: https://code.wildfiregames.com/D3760

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/simulation2/components/CCmpUnitMotion.h

    r25125 r25150  
    16331633        CFixedVector2D dist(from.X - goal.x, from.Y - goal.z);
    16341634        if (dist.CompareLength(searchRange - entity_pos_t::FromInt(1)) >= 0)
     1635
    16351636            searchRange = dist.Length() + fixed::FromInt(1);
     1637
     1638
     1639
    16361640    }
    16371641
Note: See TracChangeset for help on using the changeset viewer.