Skip to content
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

Undertale: /savepath fix #2144

Conversation

masterwackerly
Copy link

What is this fixing or adding?

Updates the /savepath command to edit the instantiated self.ctx instead of the static UndertaleContext

How was this tested?

Platform: Linux Mint
Ran from AppImage, precompiled executables, and from source, player inventory did not update upon connecting to server.
Sourced .item files from a Windows user testing the same seed, player inventory was updated.
Ran from modified source on a new save file, player inventory updates as expected.

If this makes graphical changes, please attach screenshots.

No graphical changes.

Updates the /savepath command to edit the instantiated self.ctx instead of the static UndertaleContext
@black-sliver
Copy link
Member

Hm, the fix seems to be correct, I'm not happy with the current state of members in UndertaleContext though. It is completely unclear what is supposed to be "static", what is supposed to be "member" and what is supposed to be "member if set, otherwise fall back to default static". @jonloveslegos

The best way to mark something as a "non-static" member is to type hint it in the class body and then assign in __init__, like so

class MyClass:
    a: int

    def __init__(self):
        self.a = 1

@masterwackerly
Copy link
Author

I don't understand the rest of the code that well or its intent, I just changed one line that seemed wrong and that happened to do the trick. If there's a better solution I wouldn't be offended nor surprised

@ThePhar ThePhar added the is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. label Oct 16, 2023
@black-sliver
Copy link
Member

Forgot to close it until now. This change was already merged in #2146. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants