Skip to content

Conversation

@Slayer2505
Copy link

"Fix inventory persistence: do not save collected items until scene changes"

"Fix inventory persistence: do not save collected items until scene changes"
@Slayer2505 Slayer2505 requested a review from a team as a code owner November 27, 2025 17:58
Copy link
Member

@wjt wjt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you deleted all the documentation comments? Please revise this to restore them. It's hard to review the actual changes when most of the highlighted changes are deleting perfectly good comments

Please translate your new comments to English. (It's OK if the English is not perfect of course!)

@Slayer2505 Slayer2505 requested a review from wjt November 27, 2025 18:27
Comment on lines +58 to +59
## Internal flag used to delay inventory persistence until the scene changes.
## This ensures items are not saved the moment they are collected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use # for internal fields. Adding a ## comment causes it to show up in the API documentation for the class; but we don't want this one to be there since it shouldn't be read/modified outside this file.

Suggested change
## Internal flag used to delay inventory persistence until the scene changes.
## This ensures items are not saved the moment they are collected.
# Internal flag used to delay inventory persistence until the scene changes.
# This ensures items are not saved the moment they are collected.
_do_set_scene(scene_path, spawn_point)

# If inventory changes were pending, write them now.
if _pending_inventory_save:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this flag. I think you can just unconditionally call _write_inventory_to_state() here?

func start_quest(quest: Quest) -> void:
_do_clear_inventory()
_update_inventory_state()
_mark_inventory_dirty() # Deferred saving
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be deferred when starting a quest - it should be cleared immediately.

@wjt
Copy link
Member

wjt commented Dec 1, 2025

There are now conflicts in game_state.gd - probably due to commit 5e999e8 from #1679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants