fix #187, also resolving hotfixes to prevent its occurrence. Was caused by postit selection state having one less option

This commit is contained in:
betalars 2025-06-04 13:58:53 +02:00
parent dd90f191fd
commit 3ef3647f45
1 changed files with 6 additions and 7 deletions

View File

@ -130,8 +130,6 @@ func _input(event):
if event.is_action_pressed("ui_accept"):
pick(curr_selection_id)
elif event.is_action_pressed("skip"):
#FIXME resolve weird issues when animations are being skipped
return
$Meaning.stop()
if selection_state == CARDS_SELECTED:
picked_player.play("skip_pick", .1)
@ -184,12 +182,13 @@ func pick(id: int):
var winning_id
print("Randomly selected card %s" % options[1].text)
if not current_scene_id == Scenes.id.YOUTH_JUI_JUTSU:
if not (current_scene_id == Scenes.id.YOUTH_JUI_JUTSU and selection_state == CARDS_SELECTED):
randomize()
# investigate if this fixes error on line 197
winning_id = randi() % options.size()-1
winning_id = randi() % options.size() - ( 1 if selection_state == POSTS_SELECTED else 0)
else:
winning_id = 1 if id == 0 else 0
if Steamworks.has_initialized:
Steam.setAchievement("FIGHT_BACK")
Steam.storeStats()
@ -231,7 +230,7 @@ func transition():
func show_posts():
for player:AnimationPlayer in anim_players:
player.play("RESET")
await get_tree().create_timer(1).timeout
await get_tree().create_timer(.5).timeout
selection_state = POSTS