(svn r7726) -Fix (r7622, FS#497): segmentation fault on pressing the 'sell all airplanes'.
authorrubidium
Mon, 01 Jan 2007 18:54:18 +0000
changeset 5460 dd591800bf3f
parent 5459 d36603bebbaa
child 5461 f056fa8bf44c
(svn r7726) -Fix (r7622, FS#497): segmentation fault on pressing the 'sell all airplanes'.
depot_gui.c
--- a/depot_gui.c	Mon Jan 01 18:14:26 2007 +0000
+++ b/depot_gui.c	Mon Jan 01 18:54:18 2007 +0000
@@ -779,11 +779,11 @@
 							STR_A002_AIRCRAFT_HANGAR
 						};
 						TileIndex tile = w->window_number;
-						byte vehtype = WP(w, depot_d).type - VEH_Train;
+						byte vehtype = WP(w, depot_d).type;
 
 						SetDParam(0, (vehtype == VEH_Aircraft) ? GetStationIndex(tile) : GetDepotByTile(tile)->town_index);
 						ShowQuery(
-							confirm_captions[vehtype],
+							confirm_captions[vehtype - VEH_Train],
 							STR_DEPOT_SELL_CONFIRMATION_TEXT,
 							w,
 							DepotSellAllConfirmationCallback