-
Notifications
You must be signed in to change notification settings - Fork 733
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
Core: Make excluded locations and priority locations excluded and remove unreachable code #3424
Conversation
i would much rather you remove the try except than pass on an exception which could have very bad implications |
I'm not sure how you can do that, since removing the try/except causes |
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.
Code looks fine, a player probably shouldn't get to priority a location if the world has excluded it so the change is good
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.
i still don't like that this is ignoring exceptions. why are you removing handling of user error? world_excluded_locations
also seems unnecessary. you can just remove directly from the priority locations set instead of creating another set just to use for removal.
If you want to do that, feel free. It threw an error for me about modifying while iterating. This is also the same as what the error did earlier, so it's not making it worse |
And like I said earlier, this isn't removing user-error, this is handling that fact that locations that fail |
According to the diff that's the old behavior which you're removing here? |
I keep thinking of new points, so sorry for the third reply, but can you give any example of a user error that does anything here? Every possible error is already covered, as explained in the PR's description. If a user includes a location that doesn't exist at all, it errors far earlier, and if a user includes a location that does exist but not for this particular instance of the game it shouldn't error, and so the |
Ah right, the options system validates the names way before this. It still feels wrong to have a try except where we just ignore the exception though. I wonder if it makes sense to at least log a warning? |
I could add |
If you did this, would it log an error for each location in a location group? |
Yes, but it handling different from every other thing such as excluded locations, start hints, start location hints, etc. makes me not want to add it, at least not in this PR |
I am perfectly fine with the try-except with continue and nothing else. |
…ove unreachable code (ArchipelagoMW#3424) * Make excluded and priority locations excluded * Only pass on KeyError * Alternative/Clearer format
What is this fixing or adding?
If a location's
progress_type
was set toEXCLUDED
and it was in a user'spriority_locations
, it would end up prioritized. In contrast, if something is in bothexclude_locations
andpriority_locations
, it ends up excluded. This makes it so that dev/world-excluded locations stay excluded and are removed frompriority_locations
(matching the behavior of using bothexcluded
andpriority
through user-facing options) and a warning is logged if this overrides a user'spriority_locations
option.This also simplifies part of an exception that could not be reached because of an earlier key verification exception with LocationSet key verfication.
How was this tested?
Generations with games that set
progress_type
and viewing spoiler logs.