mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Fixed a bug where the unit needs the civInfo in order to calculate the moveTo even before it's put on the map.
This commit is contained in:
parent
40db822a79
commit
9e5208dd8c
10
Credits.md
10
Credits.md
@ -74,8 +74,8 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
|||||||
* [Factory](https://thenounproject.com/term/factory/1049531/) By RULI
|
* [Factory](https://thenounproject.com/term/factory/1049531/) By RULI
|
||||||
* [Mine](https://thenounproject.com/term/mine/543/) By Edward Boatman
|
* [Mine](https://thenounproject.com/term/mine/543/) By Edward Boatman
|
||||||
* [Corral](https://thenounproject.com/term/corral/1340751/) By Luis Prado
|
* [Corral](https://thenounproject.com/term/corral/1340751/) By Luis Prado
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Plants](https://thenounproject.com/term/plants/1760916/) By hendra sudibyo
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Pickaxe](https://thenounproject.com/term/pickaxe/175792/) By Creative Stall
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Food stall](https://thenounproject.com/term/food-stall/1618358/) By I Putu Kharismayadi
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Road](https://thenounproject.com/term/road/1600491/) By REVA
|
||||||
* [Connection](https://thenounproject.com/search/?q=connection&i=1521886) By Travis Avery
|
* [Circle](https://thenounproject.com/term/circle/1841891/) By Aybige
|
@ -21,8 +21,8 @@ android {
|
|||||||
applicationId "com.unciv.game"
|
applicationId "com.unciv.game"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode 130
|
versionCode 131
|
||||||
versionName "2.7.14"
|
versionName "2.7.15"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -102,7 +102,7 @@ class DiplomacyManager() {
|
|||||||
fun declareWar(){
|
fun declareWar(){
|
||||||
diplomaticStatus = DiplomaticStatus.War
|
diplomaticStatus = DiplomaticStatus.War
|
||||||
otherCiv().diplomacy[civInfo.civName]!!.diplomaticStatus = DiplomaticStatus.War
|
otherCiv().diplomacy[civInfo.civName]!!.diplomaticStatus = DiplomaticStatus.War
|
||||||
otherCiv().addNotification("[civName] has declared war on us!",null, Color.RED)
|
otherCiv().addNotification("[${civInfo.civName}] has declared war on us!",null, Color.RED)
|
||||||
}
|
}
|
||||||
//endregion
|
//endregion
|
||||||
}
|
}
|
@ -63,12 +63,14 @@ class TileMap {
|
|||||||
|
|
||||||
val tilesInDistance = getTilesInDistance(position, 2)
|
val tilesInDistance = getTilesInDistance(position, 2)
|
||||||
|
|
||||||
unit.owner=civInfo.civName // needed in order to calculate canMoveTo
|
unit.assignOwner(civInfo) // both the civ name and actual civ need to be in here in order to calculate the canMoveTo...Darn
|
||||||
val unitToPlaceTile = tilesInDistance.firstOrNull { unit.canMoveTo(it) }
|
val unitToPlaceTile = tilesInDistance.firstOrNull { unit.canMoveTo(it) }
|
||||||
if(unitToPlaceTile!=null) {
|
if(unitToPlaceTile!=null) {
|
||||||
|
// only once we know the unit can be placed do we add it to the civ's unit list
|
||||||
unit.putInTile(unitToPlaceTile)
|
unit.putInTile(unitToPlaceTile)
|
||||||
unit.assignOwner(civInfo) // only once we know the unit can be placed do we add it to the civ's unit list
|
|
||||||
}
|
}
|
||||||
|
else civInfo.units.remove(unit) // since we added it to the civ units in the previous assignOwner
|
||||||
|
|
||||||
return unit
|
return unit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user