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
Exit();
}
if (IsActive)
if (IsActive && currentGameState == GameMenuState.Playing)
{
// call mouse handler if game window is active
MouseHandler.updateMouse(graph, camera);
......
......@@ -150,7 +150,7 @@ namespace Controller
}
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
GameState.unitToAttack = unit; // set state of attacked unit
GameState.attackConfirmOpen = true; // opens attack confirmation
}
// deselects the unit if no enemy unit is clicked
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