Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Locomotor.CanMoveFreelyInto when using ignoreSelf. #21165

Merged
merged 1 commit into from
Oct 30, 2023

Commits on Oct 30, 2023

  1. Fix Locomotor.CanMoveFreelyInto when using ignoreSelf.

    The ignoreSelf flag is intended to allow the current actor to be ignored when checking for blocking actors. This check worked correctly for cells occupied by a single actor. When a cell was occupied by multiple actors, the check was only working if the current actor happened to be the first actor. This is incorrect, if the current actor is anywhere in the cell then this flag should apply.
    
    This flag failing to be as effective as intended meant that checks in methods such as PathFinder.FindPathToTargetCells would consider the source cell inaccessible, when it should have considered the cell accessible. This is a disaster for performance as an inaccessible cell requires a slow fallback path that performs a local path search. This means pathfinding was unexpectedly slow when this occurred. One scenario is force attacking with a group of infantry sharing the same cell. They should benefit from this check to do a fast path search, but failed to benefit from this check and the search would be slow instead.
    
    Applying the flag correctly resolves the performance impact.
    RoosterDragon committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    c729200 View commit details
    Browse the repository at this point in the history