summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-01 06:32:03 +0000
committertron <tron@openttd.org>2006-02-01 06:32:03 +0000
commit22dc05faf2219f6e3803f9cbff92249823bb11eb (patch)
tree567a406e1224ab13f36027469339c6c42ada96f1 /station_cmd.c
parent8cdd3261fc5e37d2d39364d9c2c1449f83b1c504 (diff)
downloadopenttd-22dc05faf2219f6e3803f9cbff92249823bb11eb.tar.xz
(svn r3510) Fiddle with whitespace and parentheses
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/station_cmd.c b/station_cmd.c
index c4cc83576..d95770560 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1210,7 +1210,6 @@ static const RealSpriteGroup *ResolveStationSpriteGroup(const SpriteGroup *spg,
if ((dsg->variable >> 6) == 0) {
/* General property */
value = GetDeterministicSpriteValue(dsg->variable);
-
} else {
if (st == NULL) {
/* We are in a build dialog of something,
@@ -1268,7 +1267,6 @@ uint32 GetCustomStationRelocation(const StationSpec *spec, const Station *st, by
if (rsg->sprites_per_set != 0) {
if (rsg->loading_count != 0) return rsg->loading[0]->g.result.result;
-
if (rsg->loaded_count != 0) return rsg->loaded[0]->g.result.result;
}
@@ -1414,18 +1412,20 @@ int32 CmdBuildRoadStop(int x, int y, uint32 flags, uint32 p1, uint32 p2)
//give us a road stop in the list, and check if something went wrong
road_stop = AllocateRoadStop();
- if (road_stop == NULL)
- return_cmd_error( (type) ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
+ if (road_stop == NULL) {
+ return_cmd_error(type ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
+ }
- if ( st != NULL && (GetNumRoadStops(st, RS_BUS) + GetNumRoadStops(st, RS_TRUCK) >= ROAD_STOP_LIMIT))
- return_cmd_error( (type) ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
+ if (st != NULL && GetNumRoadStops(st, RS_BUS) + GetNumRoadStops(st, RS_TRUCK) >= ROAD_STOP_LIMIT) {
+ return_cmd_error(type ? STR_3008B_TOO_MANY_TRUCK_STOPS : STR_3008A_TOO_MANY_BUS_STOPS);
+ }
if (st != NULL) {
- if (st->owner != OWNER_NONE && st->owner != _current_player)
+ if (st->owner != OWNER_NONE && st->owner != _current_player) {
return_cmd_error(STR_3009_TOO_CLOSE_TO_ANOTHER_STATION);
+ }
- if (!CheckStationSpreadOut(st, tile, 1, 1))
- return CMD_ERROR;
+ if (!CheckStationSpreadOut(st, tile, 1, 1)) return CMD_ERROR;
FindRoadStationSpot(type, st, &currstop, &prev);
} else {
@@ -1438,8 +1438,9 @@ int32 CmdBuildRoadStop(int x, int y, uint32 flags, uint32 p1, uint32 p2)
FindRoadStationSpot(type, st, &currstop, &prev);
- if (_current_player < MAX_PLAYERS && flags&DC_EXEC)
+ if (_current_player < MAX_PLAYERS && flags & DC_EXEC) {
SETBIT(t->have_ratings, _current_player);
+ }
st->sign.width_1 = 0;
@@ -1486,8 +1487,9 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
RoadStop *cur_stop;
bool is_truck = _m[tile].m5 < 0x47;
- if (_current_player != OWNER_WATER && !CheckOwnership(st->owner))
+ if (_current_player != OWNER_WATER && !CheckOwnership(st->owner)) {
return CMD_ERROR;
+ }
if (is_truck) { // truck stop
primary_stop = &st->truck_stops;
@@ -1499,8 +1501,7 @@ static int32 RemoveRoadStop(Station *st, uint32 flags, TileIndex tile)
assert(cur_stop != NULL);
- if (!EnsureNoVehicle(tile))
- return CMD_ERROR;
+ if (!EnsureNoVehicle(tile)) return CMD_ERROR;
if (flags & DC_EXEC) {
uint i;
@@ -1671,8 +1672,7 @@ int32 CmdBuildAirport(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (!GenerateStationName(st, tile, (p1 == AT_HELIPORT) ? 5 : 1))
return CMD_ERROR;
- if (flags & DC_EXEC)
- StationInitialize(st, tile);
+ if (flags & DC_EXEC) StationInitialize(st, tile);
}
cost += _price.build_airport * w * h;