Skip to content

Commit

Permalink
Fixed Bug causing softlock
Browse files Browse the repository at this point in the history
  • Loading branch information
andremcorreia committed Jan 12, 2025
1 parent d3ea533 commit ba28ffc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ Stats.txt
# Temp files
*.tmp
*.tmp.*
Board.png
Board.png.import
Drawer.png
Drawer.png.import
4 changes: 2 additions & 2 deletions tangran/Scenes/Main_scene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func setPlayerTurn():

# TODO: ADD INTERACTION TO INTERACTION HISTORY, may not use relative move grammar, and coordinates instead
func finishPlayerTurn():
if movedPiece and current_turn == "Player" and not hasRequest:
if movedPiece and not dragging and current_turn == "Player" and not hasRequest:
current_turn = "AI"
thinking_asc = true
time_elapsed = 0.0
Expand All @@ -79,7 +79,7 @@ func finishPlayerTurn():
ai_play() #TODO: ADD HISTORY AND INSTRUCTION AS CONTEXT

func _undo_play():
if movedPiece and current_turn == "Player":
if movedPiece and not dragging and current_turn == "Player":
get_node(movedPiece).position = originalPos
get_node(movedPiece).rotation = originalRot
movedPiece = ""
Expand Down

0 comments on commit ba28ffc

Please sign in to comment.