Browse Source

Fix possibility to start a new round before its end

Was causing a bug by the way.
DricomDragon 5 năm trước cách đây
mục cha
commit
efe280ba8b
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      Game.gd

+ 3 - 5
Game.gd

@@ -57,11 +57,9 @@ func load_level(name):
 
 func _unhandled_input(event):
 	if event.is_action("ui_accept") and event.is_pressed():
-		if get_tree().has_group("running"):
-			var running = get_tree().get_nodes_in_group("running")
-			if !running.empty():
-				return
-		create_game()
+		if is_round_won == null or is_round_won:
+			is_round_won = false
+			create_game()
 
 func create_game():
 	# Clear if required