diff --git a/core/src/com/unciv/ui/screens/devconsole/ConsoleCityCommands.kt b/core/src/com/unciv/ui/screens/devconsole/ConsoleCityCommands.kt index b9ba202785..684c51fdcf 100644 --- a/core/src/com/unciv/ui/screens/devconsole/ConsoleCityCommands.kt +++ b/core/src/com/unciv/ui/screens/devconsole/ConsoleCityCommands.kt @@ -40,13 +40,17 @@ internal class ConsoleCityCommands : ConsoleCommandNode { DevConsoleResponse.OK }, - "addtile" to ConsoleAction("city addtile ") { console, params -> + "addtile" to ConsoleAction("city addtile [radius]") { console, params -> val selectedTile = console.getSelectedTile() val city = console.getCity(params[0]) if (selectedTile.neighbors.none { it.getCity() == city }) throw ConsoleErrorException("Tile is not adjacent to any tile already owned by the city") if (selectedTile.isCityCenter()) throw ConsoleErrorException("Cannot transfer city center") - city.expansion.takeOwnership(selectedTile) + val radius = params.getOrNull(1)?.toInt() ?: 0 + for (tile in selectedTile.getTilesInDistance(radius)) { + if (tile.getCity() != city && !tile.isCityCenter()) + city.expansion.takeOwnership(tile) + } DevConsoleResponse.OK }, diff --git a/core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt b/core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt index 9ab823fa40..5a09cd0b9b 100644 --- a/core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt +++ b/core/src/com/unciv/ui/screens/devconsole/DevConsolePopup.kt @@ -163,7 +163,7 @@ class DevConsolePopup(val screen: WorldScreen) : Popup(screen) { } private fun handleCommand(): DevConsoleResponse { - val params = textField.text.splitToCliInput() + val params = textField.text.trim().splitToCliInput() return commandRoot.handle(this, params) }