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
Check that noiseDirection is not a zero #11670
Conversation
@@ -111,6 +111,10 @@ void RescanForTargets(Actor self) | |||
|
|||
while (!self.World.Map.Contains(moveTo) || !mobile.CanEnterCell(moveTo, null, false)) | |||
{ | |||
// without this check, this while statement can be infinity loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to move the (moveTo == self.Location)
check below inside this loop instead. That will catch the error case faster, and cancel the activity before returning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the (moveTo == self.Location)
not moved, but copied this check into while statement and leave additional check after while statement.
check latest value after while loop too
@@ -111,6 +111,13 @@ void RescanForTargets(Actor self) | |||
|
|||
while (!self.World.Map.Contains(moveTo) || !mobile.CanEnterCell(moveTo, null, false)) | |||
{ | |||
// without this check, this while can be infinity loop | |||
if (moveTo == self.Location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can the sandworm ever end up at a location that is either not in the map, or that it cannot enter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spawner outside the cordon, or on a cell with another actor?
Fair enough. 👍 |
👍 |
fix unexpected freezes that can happen because of infinity loop in RescanForTargets