diff --git a/client/scripts/main.gd b/client/scripts/main.gd index 4c88edc..a03c16e 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -869,11 +869,11 @@ func _setup_quest_progress_sync() -> void: Callable(self, "_on_quest_completion_reward_transition") ) - func _on_quest_completion_reward_transition(_quest_id: String, _summary: Dictionary) -> void: _request_inventory_refresh() - if is_instance_valid(_skill_progression_client) and _skill_progression_client.has_method("request_sync_from_server"): - _skill_progression_client.call("request_sync_from_server") + var skill_client := _skill_progression_client + if is_instance_valid(skill_client) and skill_client.has_method("request_sync_from_server"): + skill_client.call("request_sync_from_server") func _request_quest_progress_refresh() -> void: diff --git a/client/test/quest_reward_hud_test.gd b/client/test/quest_reward_hud_test.gd index 67f3421..96dc810 100644 --- a/client/test/quest_reward_hud_test.gd +++ b/client/test/quest_reward_hud_test.gd @@ -288,6 +288,20 @@ func test_completion_transition_emits_economy_refresh_signal() -> void: await assert_signal(controller).is_emitted("quest_completion_reward_transition", any()) +func test_completion_transition_invokes_economy_refresh_callback() -> void: + # Arrange + var controller: Node = QuestHudController.new() + var called := false + auto_free(controller) + add_child(controller) + controller.set("_economy_refresh_callback", func(_qid, _summary): called = true) + # Act + controller.call("_on_progress_received", _active_gather_snapshot()) + controller.call("_on_progress_received", _completed_gather_with_summary_snapshot()) + # Assert + assert_bool(called).is_true() + + func test_boot_completed_does_not_emit_economy_refresh_signal() -> void: # Arrange var controller: Node = QuestHudController.new()