diff options
author | zuu <zuu@openttd.org> | 2013-09-19 18:48:05 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-09-19 18:48:05 +0000 |
commit | 67ab3108d6b4ca9676871cabdae3ed187d51393d (patch) | |
tree | bed3b9842803eb94ce1280431ab58fd6aca33a95 /src/town_cmd.cpp | |
parent | 953aa839b9954b3098ffc5932ab6bd0910b8ae46 (diff) | |
download | openttd-67ab3108d6b4ca9676871cabdae3ed187d51393d.tar.xz |
(svn r25785) -Feature: [Script] Allow AIs and GS to found towns. Allow GS to rename towns
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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)) { |