diff options
author | smatz <smatz@openttd.org> | 2008-07-09 20:55:47 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-07-09 20:55:47 +0000 |
commit | 447ec39f49e89689dc9070fe88c8eafc39a60fbe (patch) | |
tree | d7f550bb34964fafacec7f8c559f7e43aa32e91e /src/ship_cmd.cpp | |
parent | 33150af3e2ca85326e5b84999ae8729ec65b338c (diff) | |
download | openttd-447ec39f49e89689dc9070fe88c8eafc39a60fbe.tar.xz |
(svn r13691) -Codechange: make it easier to determine whether a command is ran in the context of autoreplace or not
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 2af35c307..98f718a80 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -748,7 +748,7 @@ void ShipsYearlyLoop() * @param tile tile of depot where ship is built * @param flags type of operation * @param p1 ship type being built (engine) - * @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number + * @param p2 unused */ CommandCost CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { @@ -766,7 +766,7 @@ CommandCost CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (!IsShipDepotTile(tile)) return CMD_ERROR; if (!IsTileOwner(tile, _current_player)) return CMD_ERROR; - unit_num = HasBit(p2, 0) ? 0 : GetFreeUnitNumber(VEH_SHIP); + unit_num = (flags & DC_AUTOREPLACE) ? 0 : GetFreeUnitNumber(VEH_SHIP); if (!Vehicle::AllocateList(NULL, 1) || unit_num > _settings_game.vehicle.max_ships) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); |