summaryrefslogtreecommitdiff
path: root/src/object_cmd.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2013-10-17 21:37:25 +0000
committerplanetmaker <planetmaker@openttd.org>2013-10-17 21:37:25 +0000
commit2ee9a2b5e70bb52ae08d8d18d94b7e082a12a63f (patch)
tree4aa8cc9e07c0c324fc198a6e3b6a6b7d72d218b7 /src/object_cmd.cpp
parent547b1fba45cb7a877cd4966a6854aeebffef0c71 (diff)
downloadopenttd-2ee9a2b5e70bb52ae08d8d18d94b7e082a12a63f.tar.xz
(svn r25875) -Change: In scenario editor allow to build all objects which were available at any point in the past to support building scenarios with historic items
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r--src/object_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 3aabb3471..7c42dce78 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -209,7 +209,8 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (type >= NUM_OBJECTS) return CMD_ERROR;
uint8 view = GB(p2, 0, 2);
const ObjectSpec *spec = ObjectSpec::Get(type);
- if (!spec->IsAvailable()) return CMD_ERROR;
+ if (_game_mode == GM_NORMAL && !spec->IsAvailable()) return CMD_ERROR;
+ if (_game_mode == GM_EDITOR && !spec->WasEverAvailable()) return CMD_ERROR;
if (spec->flags & OBJECT_FLAG_ONLY_IN_SCENEDIT && (_game_mode != GM_EDITOR || _current_company != OWNER_NONE)) return CMD_ERROR;
if (spec->flags & OBJECT_FLAG_ONLY_IN_GAME && (_game_mode != GM_NORMAL || _current_company > MAX_COMPANIES)) return CMD_ERROR;