Invalidate stale cover paths when retreat destination changes - #2086
Open
sunmachine wants to merge 1 commit into
Open
Invalidate stale cover paths when retreat destination changes#2086sunmachine wants to merge 1 commit into
sunmachine wants to merge 1 commit into
Conversation
When FindCoverArea picks a different cover area mid-retreat, the old path remained valid and kept steering the bot toward the abandoned, exposed cover until the path completed on its own (or, in the grenade case, until the 1.0s repath timer elapsed). Invalidate the path (and the repath timer, where one exists) whenever the cover area changes, matching the existing OnStuck/OnMoveToFailure handling.
sunzenshen
approved these changes
Aug 21, 2026
| // not in cover yet | ||
| if ( m_repathTimer.IsElapsed() || !m_path.IsValid() ) | ||
| { | ||
| CNEOBotPathCompute( me, m_path, m_coverArea->GetCenter(), FASTEST_ROUTE ); |
Contributor
There was a problem hiding this comment.
Note for other reviewers, this would be when the path is recalculated when the path or timer are invalidated.
|
|
||
| if ( !m_path.IsValid() ) | ||
| { | ||
| CNEOBotPathCompute( me, m_path, m_coverArea->GetCenter(), RETREAT_ROUTE ); |
Contributor
There was a problem hiding this comment.
Note for other reviewers, this would be when the path is recalculated when the path is invalidated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retreat to cover...
Shitty example
Courtesy of Don Claudio
Description
Follow-up to #2065.
When
FindCoverAreapicks a different cover area mid-retreat, the old path stayed valid and kept steering the bot toward the abandoned, exposed cover:!m_path.IsValid()is the only recompute trigger).Invalidate the path (and repath timer, where one exists) whenever the chosen cover area changes, matching the existing
OnStuck/OnMoveToFailurehandling. No change when the re-pick returns the same area.Toolchain