mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-21 13:18:56 +07:00
console: Don't allow adding cities to spectator/barbarian (will crash)
Some checks failed
Conflict marking / main (push) Failing after 9s
Detekt / detekt (ubuntu-latest) (push) Failing after 2m12s
Build and test / Check code and run unit tests (push) Failing after 7m30s
Generate mkdocs from docs folder / deploy (push) Failing after 1m35s
Close stale issues and PRs / stale (push) Successful in 40s
Docker / build (push) Failing after 2m4s
Some checks failed
Conflict marking / main (push) Failing after 9s
Detekt / detekt (ubuntu-latest) (push) Failing after 2m12s
Build and test / Check code and run unit tests (push) Failing after 7m30s
Generate mkdocs from docs folder / deploy (push) Failing after 1m35s
Close stale issues and PRs / stale (push) Successful in 40s
Docker / build (push) Failing after 2m4s
This commit is contained in:
@ -13,6 +13,8 @@ internal class ConsoleCityCommands : ConsoleCommandNode {
|
||||
|
||||
"add" to ConsoleAction("city add <civName>") { console, params ->
|
||||
val civ = console.getCivByName(params[0])
|
||||
if (!civ.isMajorCiv() && !civ.isCityState)
|
||||
throw ConsoleErrorException("Can only add cities to major civs or city states")
|
||||
val selectedTile = console.getSelectedTile()
|
||||
if (selectedTile.isCityCenter())
|
||||
throw ConsoleErrorException("Tile already contains a city center")
|
||||
|
Reference in New Issue
Block a user