Skip to content

Do not stop player-forced jobs when curPath is recalculated - #9

Open
SaintWacko wants to merge 5 commits into
fernyrepos:mainfrom
SaintWacko:main
Open

Do not stop player-forced jobs when curPath is recalculated#9
SaintWacko wants to merge 5 commits into
fernyrepos:mainfrom
SaintWacko:main

Conversation

@SaintWacko

Copy link
Copy Markdown

When a pawn crosses over a fence, their pather.curPath is recalculated twice, once on each side of it. When that happened, it triggered pawn.pather.curPath != null, causing stopDead() to be called. I believe this was needed to prevent AI control from overriding WASD control, but it was causing problems when you did want your pawn to be AI-controlled (for example, when they are going to eat food). I added an additional check so that if your pawn is on a player-forced job, it will not call stopDead() and instead allow them to continue. I also shortened the existing path checks by using the null-conditional operator.

Copilot AI lite review requested due to automatic review settings August 19, 2026 18:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adjusts Avatar movement logic to avoid interrupting player-forced jobs when pather.curPath is recalculated (notably when crossing fences), preventing unintended StopDead() calls from halting intended AI execution of a forced job.

Changes:

  • Added a playerForced guard to prevent StopDead() from firing for player-forced jobs when curPath is present.
  • Simplified existing pather/curPath null checks using the null-conditional operator.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread 1.6/Source/Avatar/Avatar_Movement.cs
Co-authored-by: SaintWacko <10342141+SaintWacko@users.noreply.github.com>
Copilot AI and others added 3 commits August 23, 2026 02:59
Co-authored-by: SaintWacko <10342141+SaintWacko@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fix merge conflict: Do not stop player-forced jobs when curPath is recalculated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants