Changeset - r14873:15b9b1a863e0
[Not reviewed]
master
0 2 0
alberth - 14 years ago 2010-03-20 10:59:06
alberth@openttd.org
(svn r19479) -Codechange: Test range of town size and layout instead of against the current last value.
2 files changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/town_cmd.cpp
Show inline comments
 
@@ -1525,8 +1525,8 @@ CommandCost CmdFoundTown(TileIndex tile,
 
	bool random = HasBit(p1, 6);
 
	uint32 townnameparts = p2;
 

	
 
	if (size > TSZ_RANDOM) return CMD_ERROR;
 
	if (layout > TL_RANDOM) return CMD_ERROR;
 
	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) {
src/town_type.h
Show inline comments
 
@@ -23,6 +23,8 @@ enum TownSize {
 
	TSZ_MEDIUM, ///< Medium town.
 
	TSZ_LARGE,  ///< Large town.
 
	TSZ_RANDOM, ///< Random size, bigger than small, smaller than large.
 

	
 
	TSZ_END,    ///< Number of available town sizes.
 
};
 

	
 
enum {
0 comments (0 inline, 0 general)