summaryrefslogtreecommitdiff
path: root/aircraft_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-27 21:25:53 +0000
committertron <tron@openttd.org>2006-06-27 21:25:53 +0000
commit2b27073156f40df263cf653263488b8d72a76236 (patch)
tree1bfdb9c99b43fdc3b07ac13cbed4259a06d34f6f /aircraft_gui.c
parentc126ce110ee33bffe07dac5283d8a1648dc662b7 (diff)
downloadopenttd-2b27073156f40df263cf653263488b8d72a76236.tar.xz
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index d4ec54d8f..4b988bf8d 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -279,7 +279,7 @@ static void AircraftRefitWndProc(Window *w, WindowEvent *e)
if (DoCommandP(v->tile, v->index, WP(w,refit_d).cargo, NULL, CMD_REFIT_AIRCRAFT | CMD_MSG(STR_A042_CAN_T_REFIT_AIRCRAFT)))
DeleteWindow(w);
}
- break;
+ break;
}
break;
}
@@ -695,8 +695,7 @@ static int GetVehicleFromAircraftDepotWndPt(const Window *w, int x, int y, Vehic
row = (y - 14) / 24;
ym = (y - 14) % 24;
- if (row >= w->vscroll.cap)
- return 1;
+ if (row >= w->vscroll.cap) return 1;
pos = (row + w->vscroll.pos) * w->hscroll.cap + xt;
@@ -811,14 +810,14 @@ static void AircraftDepotWndProc(Window *w, WindowEvent *e)
}
break;
- case WE_PLACE_OBJ: {
+ case WE_PLACE_OBJ:
ClonePlaceObj(w);
- } break;
+ break;
- case WE_ABORT_PLACE_OBJ: {
+ case WE_ABORT_PLACE_OBJ:
CLRBIT(w->click_state, 8);
InvalidateWidget(w, 8);
- } break;
+ break;
// check if a vehicle in a depot was clicked..
case WE_MOUSELOOP: {
@@ -924,7 +923,8 @@ void ShowAircraftDepotWindow(TileIndex tile)
}
}
-static void DrawSmallOrderList(const Vehicle *v, int x, int y) {
+static void DrawSmallOrderList(const Vehicle* v, int x, int y)
+{
const Order *order;
int sel, i = 0;
@@ -1068,22 +1068,19 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
case 7: { /* Matrix to show vehicles */
uint32 id_v = (e->click.pt.y - PLY_WND_PRC__OFFSET_TOP_WIDGET) / PLY_WND_PRC__SIZE_OF_ROW_BIG;
+ const Vehicle* v;
if (id_v >= w->vscroll.cap) return; // click out of bounds
id_v += w->vscroll.pos;
- {
- Vehicle *v;
+ if (id_v >= vl->list_length) return; // click out of list bound
- if (id_v >= vl->list_length) return; // click out of list bound
+ v = GetVehicle(vl->sort_list[id_v].index);
- v = GetVehicle(vl->sort_list[id_v].index);
-
- assert(v->type == VEH_Aircraft && v->subtype <= 2);
+ assert(v->type == VEH_Aircraft && v->subtype <= 2);
- ShowAircraftViewWindow(v);
- }
+ ShowAircraftViewWindow(v);
} break;
case 9: /* Build new Vehicle */
@@ -1092,9 +1089,7 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
break;
case 10:
- if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
- break;
-
+ if (!IsWindowOfPrototype(w, _player_aircraft_widgets)) break;
ShowReplaceVehicleWindow(VEH_Aircraft);
break;