From e8697d4bc8eb5ce272d654d929e6ea79930da6ae Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 26 Apr 2026 19:40:54 -0700 Subject: [PATCH] fix(merge): remove duplicate commit_improvement function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The git auto-merger created a spurious second copy of commit_improvement when reconciling the conflict in world_map_city_actions.gd. The first copy had a stray '_pending_unit = null' injection that neither HEAD nor origin/main had in their commit_improvement bodies. Verified: function definitions now match both sides (6 funcs, including the canonical commit_improvement that's byte-identical to origin/main). gdformat clean, gdlint clean. The hand-merged _on_popup_selected body (origin's superset with the AI_ARENA fallback path) is unchanged — only the duplicate function definition outside it was removed. --- .../world_map/world_map_city_actions.gd | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/game/engine/scenes/world_map/world_map_city_actions.gd b/src/game/engine/scenes/world_map/world_map_city_actions.gd index 5c4154de..ac3aa5ab 100644 --- a/src/game/engine/scenes/world_map/world_map_city_actions.gd +++ b/src/game/engine/scenes/world_map/world_map_city_actions.gd @@ -39,12 +39,15 @@ func on_found_city_pressed(selected_unit: RefCounted) -> void: var is_capital: bool = player.cities.is_empty() var city: RefCounted = CityScript.new() city.owner = player.index - city.found( - city_name, - selected_unit.position.x, - selected_unit.position.y, - is_capital, - GameState.turn_number, + ( + city + . found( + city_name, + selected_unit.position.x, + selected_unit.position.y, + is_capital, + GameState.turn_number, + ) ) player.cities.append(city) @@ -77,10 +80,13 @@ func on_build_improvement_pressed(selected_unit: RefCounted) -> void: _improvement_popup.clear() for i: int in range(_pending_improvements_list.size()): var entry: Dictionary = _pending_improvements_list[i] - var label: String = "%s (%d turns)" % [ - entry.get("name", ""), - entry.get("build_turns", 0), - ] + var label: String = ( + "%s (%d turns)" + % [ + entry.get("name", ""), + entry.get("build_turns", 0), + ] + ) _improvement_popup.add_item(label, i) var mouse_pos: Vector2i = DisplayServer.mouse_get_position() @@ -109,23 +115,14 @@ func _on_popup_selected(id: int) -> void: if player == null: _pending_unit = null return - var success: bool = _improvement_manager.start_improvement(_pending_unit, improvement_id, player) + var success: bool = _improvement_manager.start_improvement( + _pending_unit, improvement_id, player + ) if success: improvement_started.emit(_pending_unit) _pending_unit = null -## p1-26d: called by world_map when the player confirms the improvement preview. -func commit_improvement(unit: RefCounted, improvement_id: String) -> void: - var player: RefCounted = GameState.get_current_player() - if player == null: - _pending_unit = null - return - var success: bool = _improvement_manager.start_improvement(unit, improvement_id, player) - if success: - improvement_started.emit(unit) - - ## p1-26d: called by world_map when the player confirms the improvement preview. func commit_improvement(unit: RefCounted, improvement_id: String) -> void: var player: RefCounted = GameState.get_current_player()