mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-24 22:59:34 +07:00
Merge branch 'master' of https://github.com/yairm210/Unciv
This commit is contained in:
@ -443,9 +443,9 @@ open class TileInfo {
|
|||||||
|
|
||||||
return when (tileMap.getNeighborTileClockPosition(this, otherTile)) {
|
return when (tileMap.getNeighborTileClockPosition(this, otherTile)) {
|
||||||
2 -> otherTile.hasBottomLeftRiver // we're to the bottom-left of it
|
2 -> otherTile.hasBottomLeftRiver // we're to the bottom-left of it
|
||||||
4 -> hasBottomRightRiver // we're to the top-right of it
|
4 -> hasBottomRightRiver // we're to the top-left of it
|
||||||
6 -> hasBottomRiver // we're directly above it
|
6 -> hasBottomRiver // we're directly above it
|
||||||
8 -> hasBottomLeftRiver // we're to the top-left of it
|
8 -> hasBottomLeftRiver // we're to the top-right of it
|
||||||
10 -> otherTile.hasBottomRightRiver // we're to the bottom-right of it
|
10 -> otherTile.hasBottomRightRiver // we're to the bottom-right of it
|
||||||
12 -> otherTile.hasBottomRiver // we're directly below it
|
12 -> otherTile.hasBottomRiver // we're directly below it
|
||||||
else -> throw Exception("Should never call this function on a non-neighbor!")
|
else -> throw Exception("Should never call this function on a non-neighbor!")
|
||||||
|
@ -581,7 +581,15 @@ open class TileGroup(var tileInfo: TileInfo, var tileSetStrings:TileSetStrings)
|
|||||||
else ImageGetter.getImage(tileSetStrings.railroad)
|
else ImageGetter.getImage(tileSetStrings.railroad)
|
||||||
roadImage.image = image
|
roadImage.image = image
|
||||||
|
|
||||||
val relativeHexPosition = tileInfo.position.cpy().sub(neighbor.position)
|
val relativeHexPosition = when (tileInfo.tileMap.getNeighborTileClockPosition(neighbor, tileInfo)){
|
||||||
|
2 -> Vector2(0f,1f)
|
||||||
|
4 -> Vector2(-1f,0f)
|
||||||
|
6 -> Vector2(-1f,-1f)
|
||||||
|
8 -> Vector2(0f,-1f)
|
||||||
|
10 -> Vector2(1f,0f)
|
||||||
|
12 -> Vector2(1f,1f)
|
||||||
|
else -> Vector2.Zero
|
||||||
|
}
|
||||||
val relativeWorldPosition = HexMath.hex2WorldCoords(relativeHexPosition)
|
val relativeWorldPosition = HexMath.hex2WorldCoords(relativeHexPosition)
|
||||||
|
|
||||||
// This is some crazy voodoo magic so I'll explain.
|
// This is some crazy voodoo magic so I'll explain.
|
||||||
|
Reference in New Issue
Block a user