Repository navigation
Fix mob chase reading a cleared path after checking in-range - #11906
Merged
Merged
Conversation
sruon
approved these changes
Oct 30, 2026
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.
I affirm:
What does this pull request do?
This has been around for a little bit but our ASAN crash has picked it up. When a mob is chasing someone and is following a route and it getsd wtihin attack range its double checking the route by asking the navmesh for a new one. That means it throws the old check away -> looks for a new one but since the mob is now on top of the player the mesh returns nothing.
This fails in two spots:
Code wise
CMobController::Move()saves the path before this actually hapens so its saying "i am following a route" but when it gets to where its being called and its on top of the player then that is no longer true which means the route is now empty...which is callingstd::vector::back()on a now empty vector -> boom crash on ASAN and nowhere else. You wont see this crash even on a release linux build.This fix I have is checking whether the mob is following a route after the double check instead of before it. So when the double check comes back empty the mob will just say hey im in range and i can see the target so stand and attack.
On any other build other than asan you wont actually see any change at all.
One thing I did not change and not sure how to go about this is when a mob is in attack range, can see its target but cant walk to it because the mesh doesnt allow it to (ledge, or gap) it will also crash on ASAN.
Steps to test these changes
Unless you have a linux box with ASAN enabled you wont actually see this. But if you do you can just simply run mobs around any which way you want and then double beck into them. It will eventually crash.