If the selected unit was a civilian unit of ours that was captured, it is no longer selected.

This commit is contained in:
Yair Morgenstern 2018-06-13 13:27:59 +03:00
parent 0eb28ab679
commit 0468adc130

View File

@ -38,11 +38,18 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
if(selectedUnit!=null) if(selectedUnit!=null)
{ {
try{ selectedUnit!!.getTile()} if(selectedUnit!!.civInfo != worldScreen.civInfo) { // The unit that was selected, was captured. It exists but is no longer ours.
catch(ex:Exception) { selectedUnit = null
selectedUnit=null; currentlyExecutingAction = null
currentlyExecutingAction=null }
} // The unit that was there no longer exists} else {
try {
selectedUnit!!.getTile()
} catch (ex: Exception) { // The unit that was there no longer exists}
selectedUnit = null
currentlyExecutingAction = null
}
}
} }
if(selectedUnit!=null) { if(selectedUnit!=null) {