summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-05-16 12:04:53 +0000
committercelestar <celestar@openttd.org>2006-05-16 12:04:53 +0000
commit476ad49ac05af1cdbc387a74edb5364161635c83 (patch)
treea4d14433304cd29eee64a9f50b7f1297078fcc7d /tunnelbridge_cmd.c
parentb6006511d31e2246dc0438bd19815b7b1e54e6c7 (diff)
downloadopenttd-476ad49ac05af1cdbc387a74edb5364161635c83.tar.xz
(svn r4881) -Codechange: Be a little more strict about types and remove some null-operations
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index bae9977f0..a76f931ef 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -183,9 +183,10 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
int bridge_type;
TransportType transport;
RailType railtype;
- int x;
- int y;
- int sx,sy;
+ uint x;
+ uint y;
+ uint sx;
+ uint sy;
TileIndex tile_start;
TileIndex tile_end;
Slope tileh_start;
@@ -227,16 +228,10 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
if (x == sx) {
if (y == sy) return_cmd_error(STR_5008_CANNOT_START_AND_END_ON);
direction = AXIS_Y;
- if (y > sy) {
- intswap(y,sy);
- intswap(x,sx);
- }
+ if (y > sy) intswap(y,sy);
} else if (y == sy) {
direction = AXIS_X;
- if (x > sx) {
- intswap(y,sy);
- intswap(x,sx);
- }
+ if (x > sx) intswap(x,sx);
} else {
return_cmd_error(STR_500A_START_AND_END_MUST_BE_IN);
}