fix case where viewportIsFocusedOnEntity is called with no args#3122
Merged
duncanspumpkin merged 4 commits intoOpenLoco:masterfrom Jun 30, 2025
Merged
Conversation
13c2914 to
90b37dc
Compare
ZehMatt
reviewed
Jun 13, 2025
Add ZehMatts suggestion Co-authored-by: Matt <5415177+ZehMatt@users.noreply.github.com>
ZehMatt
reviewed
Jun 15, 2025
src/OpenLoco/src/Ui/Window.cpp
Outdated
| } | ||
|
|
||
| // If the argument provided is not EntityId::null check for a match. | ||
| if (targetEntity != EntityId::null && viewportConfigurations[0].viewportTargetSprite != targetEntity) |
Contributor
There was a problem hiding this comment.
I can't comment on unaffected lines, line 688 needs to be viewportConfigurations[0].viewportTargetSprite != EntityId::null to see if it follows any entity.
Contributor
Author
There was a problem hiding this comment.
hmm i had a look at this again and i still don't like how it reads, I think the way it's written makes it confusing and is probably why this keeps making bugs. I think I'll rewrite it to be explicily clear about what is happening, and remove the implicit parameter since that confuses things more
…xViewportFollowBugFrom3121
duncanspumpkin
approved these changes
Jun 30, 2025
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.
Fixes an edge case noted here #3121 (comment)