diff options
author | tron <tron@openttd.org> | 2007-02-24 09:42:39 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2007-02-24 09:42:39 +0000 |
commit | d3b29bcacb4589922a3afc85cf648609b49679dc (patch) | |
tree | cfdc363aade39ceff0da3ef6b20dbd7e95b49c83 /src/station_cmd.cpp | |
parent | 1d1121f85a975a6b9ed8305c154fc39f4f5db7fd (diff) | |
download | openttd-d3b29bcacb4589922a3afc85cf648609b49679dc.tar.xz |
(svn r8876) -Fix
Replace tests with magic numbers by a simple extraction template for command parameters
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index f60e60ec1..7bf37354c 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -6,6 +6,7 @@ #include "openttd.h" #include "aircraft.h" #include "bridge_map.h" +#include "cmd_helper.h" #include "debug.h" #include "functions.h" #include "station_map.h" @@ -787,7 +788,7 @@ static void GetStationLayout(byte *layout, int numtracks, int plat_len, const St /** Build railroad station * @param tile_org starting position of station dragging/placement * @param p1 various bitstuffed elements - * - p1 = (bit 0) - orientation (p1 & 1) + * - p1 = (bit 0) - orientation (Axis) * - p1 = (bit 8-15) - number of tracks * - p1 = (bit 16-23) - platform length * @param p2 various bitstuffed elements @@ -807,7 +808,7 @@ int32 CmdBuildRailroadStation(TileIndex tile_org, uint32 flags, uint32 p1, uint3 if (!ValParamRailtype(p2 & 0xF)) return CMD_ERROR; /* unpack parameters */ - Axis axis = (Axis)GB(p1, 0, 1); + Axis axis = Extract<Axis, 0>(p1); uint numtracks = GB(p1, 8, 8); uint plat_len = GB(p1, 16, 8); if (axis == AXIS_X) { |