summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-11-13 14:54:09 +0000
committertron <tron@openttd.org>2005-11-13 14:54:09 +0000
commit4a14a586e2f457d38e9fede1a494478105a8acfd (patch)
tree0bcf189f35802c7769cd23e20ed58a18b59d9b2e /station_cmd.c
parentee15e3de13643b2d09abcc5424bf8e2d916cff75 (diff)
downloadopenttd-4a14a586e2f457d38e9fede1a494478105a8acfd.tar.xz
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/station_cmd.c b/station_cmd.c
index a2c4acff6..c0a0203df 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -99,10 +99,9 @@ static void InitializeRoadStop(RoadStop *road_stop, RoadStop *previous, TileInde
RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type)
{
switch (type) {
- case RS_BUS: return st->bus_stops;
+ case RS_BUS: return st->bus_stops;
case RS_TRUCK: return st->truck_stops;
- default:
- NOT_REACHED();
+ default: NOT_REACHED();
}
return NULL;
@@ -677,11 +676,7 @@ static void UpdateStationAcceptance(Station *st, bool show_msg)
MergePoint(&rect, cur_rs->xy);
}
- if (_patches.modified_catchment) {
- rad = FindCatchmentRadius(st);
- } else {
- rad = 4;
- }
+ rad = (_patches.modified_catchment) ? FindCatchmentRadius(st) : 4;
// And retrieve the acceptance.
if (rect.max_x >= rect.min_x) {
@@ -1242,27 +1237,13 @@ static const RealSpriteGroup *ResolveStationSpriteGroup(const SpriteGroup *spg,
// TTDPatch runs on little-endian arch;
// Variable is 0x70 + offset in the TTD's station structure
switch (dsg->variable - 0x70) {
- case 0x80:
- value = st->facilities;
- break;
- case 0x81:
- value = st->airport_type;
- break;
- case 0x82:
- value = st->truck_stops->status;
- break;
- case 0x83:
- value = st->bus_stops->status;
- break;
- case 0x86:
- value = st->airport_flags & 0xFFFF;
- break;
- case 0x87:
- value = st->airport_flags & 0xFF;
- break;
- case 0x8A:
- value = st->build_date;
- break;
+ case 0x80: value = st->facilities; break;
+ case 0x81: value = st->airport_type; break;
+ case 0x82: value = st->truck_stops->status; break;
+ case 0x83: value = st->bus_stops->status; break;
+ case 0x86: value = st->airport_flags & 0xFFFF; break;
+ case 0x87: value = st->airport_flags & 0xFF; break;
+ case 0x8A: value = st->build_date; break;
}
}
}