Skip to content
Snippets Groups Projects
Commit bcb037be authored by Susan Yuen's avatar Susan Yuen
Browse files

Does not deselect when misclicks occur when unit is selected

parent 99b8282c
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,7 @@ namespace Controller ...@@ -159,7 +159,7 @@ namespace Controller
Exit(); Exit();
} }
if (IsActive) if (IsActive && currentGameState == GameMenuState.Playing)
{ {
// call mouse handler if game window is active // call mouse handler if game window is active
MouseHandler.updateMouse(graph, camera); MouseHandler.updateMouse(graph, camera);
......
...@@ -150,7 +150,7 @@ namespace Controller ...@@ -150,7 +150,7 @@ namespace Controller
} }
else else
{ {
GameFunction.deselectUnit(); // if user clicks on invalid end node, deselect it return; // if user clicks on invalid end node, do nothing
} }
} }
...@@ -164,10 +164,10 @@ namespace Controller ...@@ -164,10 +164,10 @@ namespace Controller
GameState.unitToAttack = unit; // set state of attacked unit GameState.unitToAttack = unit; // set state of attacked unit
GameState.attackConfirmOpen = true; // opens attack confirmation GameState.attackConfirmOpen = true; // opens attack confirmation
} }
// deselects the unit if no enemy unit is clicked
else else
{ {
GameFunction.deselectUnit(); GameState.attackSelect = true;
return; // does nothing if no enemy unit is clicked
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment