Changeset - r20836:386f9b9a07a7
[Not reviewed]
master
0 1 0
planetmaker - 11 years ago 2013-10-18 15:23:41
planetmaker@openttd.org
(svn r25880) -Fix (r25875): Special rules for world generation needs be considered in one more place
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/object_cmd.cpp
Show inline comments
 
@@ -209,11 +209,11 @@ CommandCost CmdBuildObject(TileIndex til
 
	if (type >= NUM_OBJECTS) return CMD_ERROR;
 
	uint8 view = GB(p2, 0, 2);
 
	const ObjectSpec *spec = ObjectSpec::Get(type);
 
	if (_game_mode == GM_NORMAL && !spec->IsAvailable()) return CMD_ERROR;
 
	if (_game_mode == GM_EDITOR && !spec->WasEverAvailable()) return CMD_ERROR;
 
	if (_game_mode == GM_NORMAL && !spec->IsAvailable() && !_generating_world) return CMD_ERROR;
 
	if ((_game_mode == GM_EDITOR || _generating_world) && !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;
 
	if ((spec->flags & OBJECT_FLAG_ONLY_IN_SCENEDIT) != 0 && ((!_generating_world && _game_mode != GM_EDITOR) || _current_company != OWNER_NONE)) return CMD_ERROR;
 
	if ((spec->flags & OBJECT_FLAG_ONLY_IN_GAME) != 0 && (_generating_world || _game_mode != GM_NORMAL || _current_company > MAX_COMPANIES)) return CMD_ERROR;
 
	if (view >= spec->views) return CMD_ERROR;
 

	
 
	if (!Object::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_OBJECTS);
0 comments (0 inline, 0 general)