Skip to content

Commit

Permalink
console: Don't allow adding cities to spectator/barbarian (will crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Nov 24, 2024
1 parent d816b50 commit 9dc1d5b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 9dc1d5b

Please sign in to comment.