mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-11 01:49:50 +00:00
(svn r19479) -Codechange: Test range of town size and layout instead of against the current last value.
This commit is contained in:
parent
e89f154c0d
commit
7ef97932d9
@ -1525,8 +1525,8 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
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) {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user