-
Notifications
You must be signed in to change notification settings - Fork 281
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
fix: Don't use a hook for ClientState#TerritoryType #2108
base: master
Are you sure you want to change the base?
Conversation
- We can just read this from the game data.
Why specifically, is it just because this isn't set when injecting while the game is running? I usually don't like this type of change as it makes it harder to reason about what order things are done in. i.e. the field we are reading from might be set after the hook is fired, so now subscribers that read from the field in the event won't have the correct territory. |
There will certainly be confusion as to why the |
I think that is a deal-breaker until we decouple that and also have two IDs for current and pending territory, if that is even necessary. I doubt anyone has ever needed it and our API might not need to support it, just seems confusing to people. |
I just ran into this by accident in my plugin, actually.
|
IMO if this has a more correct return type than the hook this should be the defacto way to get the territory type. |
More correct is not always == a good API, especially if it breaks existing assumptions. |
This isn't about following API properties since we are explicitly having to deal with how SE codes the systems so if this follows better to how the system works in SE code this is the correct way and what is currently breaks the assumptions about the system. |
Added as its own method because unsafe getters are ugly af.