Fix a few crashes to do with logic ordering

This commit is contained in:
CactiChameleon9 2022-07-17 17:11:43 +01:00
parent 3df809aa9d
commit 6ec76a2988
2 changed files with 7 additions and 1 deletions

View File

@ -71,8 +71,9 @@ func _physics_process(delta):
#if the enter key is pressed, input the dice into the card #if the enter key is pressed, input the dice into the card
if Input.is_action_just_pressed("ui_accept"): if Input.is_action_just_pressed("ui_accept"):
current_cards[hovering_card].dice_inputted(currently_holding_dice)
current_cards[hovering_card].hovering_dice = null current_cards[hovering_card].hovering_dice = null
current_cards[hovering_card].dice_inputted(currently_holding_dice)
hovering_card = 0
selected = false selected = false

View File

@ -17,6 +17,11 @@ func _physics_process(delta):
selected_dice = null selected_dice = null
return return
# skip turn if the list is empty
if len(current_dice) == 0:
selected = false
return
# if selected dice is null, add a value # if selected dice is null, add a value
if not selected_dice: if not selected_dice:
selected_dice = 0 selected_dice = 0