mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Units manually moved cancel existing move action
This commit is contained in:
parent
d7379508f0
commit
004cc58e13
@ -166,7 +166,8 @@ class WorldMapHolder(internal val worldScreen: WorldScreen, internal val tileMap
|
|||||||
// I can't think of any way to avoid this,
|
// I can't think of any way to avoid this,
|
||||||
// but it's so rare and edge-case-y that ignoring its failure is actually acceptable, hence the empty catch
|
// but it's so rare and edge-case-y that ignoring its failure is actually acceptable, hence the empty catch
|
||||||
selectedUnit.movement.moveToTile(tileToMoveTo)
|
selectedUnit.movement.moveToTile(tileToMoveTo)
|
||||||
if (selectedUnit.action == Constants.unitActionExplore) selectedUnit.action = null // remove explore on manual move
|
if (selectedUnit.action == Constants.unitActionExplore || selectedUnit.isMoving())
|
||||||
|
selectedUnit.action = null // remove explore on manual move
|
||||||
Sounds.play(UncivSound.Whoosh)
|
Sounds.play(UncivSound.Whoosh)
|
||||||
if (selectedUnit.currentTile != targetTile)
|
if (selectedUnit.currentTile != targetTile)
|
||||||
selectedUnit.action = "moveTo " + targetTile.position.x.toInt() + "," + targetTile.position.y.toInt()
|
selectedUnit.action = "moveTo " + targetTile.position.x.toInt() + "," + targetTile.position.y.toInt()
|
||||||
|
@ -185,8 +185,8 @@ object Github {
|
|||||||
return GameSaver.json().fromJson(RepoSearch::class.java, inputStream.bufferedReader().readText()).items
|
return GameSaver.json().fromJson(RepoSearch::class.java, inputStream.bufferedReader().readText()).items
|
||||||
}
|
}
|
||||||
|
|
||||||
class RepoSearch{
|
class RepoSearch {
|
||||||
var items=ArrayList<Repo>()
|
var items = ArrayList<Repo>()
|
||||||
}
|
}
|
||||||
|
|
||||||
class Repo {
|
class Repo {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user