forked from mirror/OpenTTD
(svn r8621) -Codechange: assigned new numbers to the VEH_(type) enum so that VEH_Train is 0, VEH_Road is 1 and so on
This means that "v->type" can be used as array indexes instead of VehTypeToIndex() (or "v->type - VEH_Train/0x10 as the code still used in some places) Surprisingly this can be done without changing the savegame format
This commit is contained in:
@@ -743,7 +743,7 @@ static void DepotWndProc(Window *w, WindowEvent *e)
|
||||
};
|
||||
|
||||
_place_clicked_vehicle = NULL;
|
||||
SetObjectToPlaceWnd(clone_icons[WP(w, depot_d).type - VEH_Train], PAL_NONE, VHM_RECT, w);
|
||||
SetObjectToPlaceWnd(clone_icons[WP(w, depot_d).type], PAL_NONE, VHM_RECT, w);
|
||||
} else {
|
||||
ResetObjectToPlace();
|
||||
}
|
||||
@@ -770,7 +770,7 @@ static void DepotWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SetDParam(0, (vehtype == VEH_Aircraft) ? GetStationIndex(tile) : GetDepotByTile(tile)->town_index);
|
||||
ShowQuery(
|
||||
confirm_captions[vehtype - VEH_Train],
|
||||
confirm_captions[vehtype],
|
||||
STR_DEPOT_SELL_CONFIRMATION_TEXT,
|
||||
w,
|
||||
DepotSellAllConfirmationCallback
|
||||
|
Reference in New Issue
Block a user