Allow tapping deployed commander to cancel any action

This commit is contained in:
drdev
2014-12-06 07:53:07 +00:00
parent 105d02e004
commit 0594785d1f

View File

@@ -287,10 +287,10 @@ public class ConquestMapScreen extends FScreen {
} }
} }
else { //deploy panel - toggle whether selected commander is deployed to current region else { //deploy panel - toggle whether selected commander is deployed to current region
if (commanderRow.selectedIndex != -1) { ConquestCommander commander = regionDisplay.deployedCommander.commander;
ConquestCommander commander = commanderRow.panels[commanderRow.selectedIndex].commander; if (commander == null) {
commander = commanderRow.panels[commanderRow.selectedIndex].commander;
if (commander.getCurrentDayAction() == null) { if (commander.getCurrentDayAction() == null) {
if (regionDisplay.deployedCommander.commander == null) {
regionDisplay.deployedCommander.setCommander(commander); regionDisplay.deployedCommander.setCommander(commander);
regionDisplay.data.setDeployedCommander(commander); regionDisplay.data.setDeployedCommander(commander);
commander.setCurrentDayAction(ConquestAction.Deploy); commander.setCurrentDayAction(ConquestAction.Deploy);
@@ -298,13 +298,13 @@ public class ConquestMapScreen extends FScreen {
} }
} }
else if (commander.getCurrentDayAction() == ConquestAction.Deploy) { else if (commander.getCurrentDayAction() == ConquestAction.Deploy) {
if (regionDisplay.deployedCommander.commander == commander) {
regionDisplay.deployedCommander.setCommander(null); regionDisplay.deployedCommander.setCommander(null);
regionDisplay.data.setDeployedCommander(null); regionDisplay.data.setDeployedCommander(null);
commander.setCurrentDayAction(null); commander.setCurrentDayAction(null);
commander.setDeployedRegion(null); commander.setDeployedRegion(null);
} }
} else {
commander.setCurrentDayAction(null);
} }
} }
} }