fix: invalid cards added to board hopefully mitigated

fix: replaying scene allows duplicate cards, causing mayhem
This commit is contained in:
tiger tiger tiger 2026-01-16 21:46:26 +01:00
parent 1bdcf6c78f
commit f8743b18b5
2 changed files with 12 additions and 7 deletions

View File

@ -216,7 +216,7 @@ func transition():
var out_str:Array[StringName] = []
for card in output:
out_str.append(card.text if card.text != "" else "c_void")
out_str.append(card.name if card.name != "" else "c_void")
cards_picked.emit(out_str)
selection_state = DONE

View File

@ -98,6 +98,7 @@ func _input(event: InputEvent) -> void:
func play_story() -> void:
var repeat := collected
collected = true
canvas_layer.show()
@ -113,15 +114,19 @@ func play_story() -> void:
# Play the story
await interaction_ui.play()
# Pick the cards
# Pick the cards if not already picked
if not repeat:
var picker := State.room.get_node("%Picker") as CardPicker
await picker.pick_cards(interaction_ui.scene_id, false)
# Hide the CanvasLayer when done
canvas_layer.hide()
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
Scenes.player_enable.emit(true) # TODO: this may not be our job?
Scenes.player_enable.emit(true)
active = true
expand()
func play_board() -> void:
@ -133,7 +138,7 @@ func play_board() -> void:
# Hide the CanvasLayer when done
canvas_layer.hide()
Scenes.player_enable.emit(true)
active = true
expand()
@ -156,7 +161,7 @@ func collect_memento() -> void:
await play_board()
canvas_layer.hide()
active = false
active = true
## Updates caption label based on the instantiated interaction_ui