From 67ab3108d6b4ca9676871cabdae3ed187d51393d Mon Sep 17 00:00:00 2001 From: zuu Date: Thu, 19 Sep 2013 18:48:05 +0000 Subject: (svn r25785) -Feature: [Script] Allow AIs and GS to found towns. Allow GS to rename towns --- src/town_cmd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/town_cmd.cpp') diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 729769212..7241f7ed4 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1621,14 +1621,17 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (size >= TSZ_END) return CMD_ERROR; if (layout >= NUM_TLS) return CMD_ERROR; - /* Some things are allowed only in the scenario editor */ - if (_game_mode != GM_EDITOR) { + /* Some things are allowed only in the scenario editor and for game scripts. */ + if (_game_mode != GM_EDITOR && _current_company != OWNER_DEITY) { if (_settings_game.economy.found_town == TF_FORBIDDEN) return CMD_ERROR; if (size == TSZ_LARGE) return CMD_ERROR; if (random) return CMD_ERROR; if (_settings_game.economy.found_town != TF_CUSTOM_LAYOUT && layout != _settings_game.economy.town_layout) { return CMD_ERROR; } + } else if (_current_company == OWNER_DEITY && random) { + /* Random parameter is not allowed for Game Scripts. */ + return CMD_ERROR; } if (StrEmpty(text)) { -- cgit v1.2.3-54-g00ecf