Skip to content

Invalidate stale cover paths when retreat destination changes - #2086

Open
sunmachine wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunmachine:pr-2065-stale-cover
Open

Invalidate stale cover paths when retreat destination changes#2086
sunmachine wants to merge 1 commit into
NeotokyoRebuild:masterfrom
sunmachine:pr-2065-stale-cover

Conversation

@sunmachine

@sunmachine sunmachine commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Retreat to cover...

image

Shitty example

Courtesy of Don Claudio

Screenshot 2026-08-20 at 22 46 24

Description

Follow-up to #2065.

When FindCoverArea picks a different cover area mid-retreat, the old path stayed valid and kept steering the bot toward the abandoned, exposed cover:

  • until the 1.0s repath timer elapsed in the grenade retreat,
  • and until the old path completed on its own in retreat-to-cover (where the timer was removed and !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/OnMoveToFailure handling. No change when the re-pick returns the same area.

Toolchain

  • Linux GCC 10 Sniper 3.0

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.
@sunmachine
sunmachine requested a review from sunzenshen August 21, 2026 06:15
// not in cover yet
if ( m_repathTimer.IsElapsed() || !m_path.IsValid() )
{
CNEOBotPathCompute( me, m_path, m_coverArea->GetCenter(), FASTEST_ROUTE );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for other reviewers, this would be when the path is recalculated when the path is invalidated.

@sunzenshen
sunzenshen requested a review from a team August 21, 2026 07:31
@sunzenshen sunzenshen added the Bots Related to bot players label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants