changeset 4784:6e2c2c377bfc draft

(svn r6698) -Code cleanup r6697: simplified getting the string of the vehicle type
author bjarni <bjarni@openttd.org>
date Sun, 08 Oct 2006 22:16:30 +0000
parents 3c41fc3b5814
children 7c3a3b9e6cb2
files vehicle.c
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/vehicle.c
+++ b/vehicle.c
@@ -2540,13 +2540,7 @@
 				v->leave_depot_instantly = false; // We ensure that the vehicle stays in the depot
 				if (v->owner == _local_player) {
 					/* Notify the user that we stopped the vehicle */
-					switch (v->type) {
-						case VEH_Train:    SetDParam(0, STR_019F_TRAIN);        break;
-						case VEH_Road:     SetDParam(0, STR_019C_ROAD_VEHICLE); break;
-						case VEH_Ship:     SetDParam(0, STR_019E_SHIP);         break;
-						case VEH_Aircraft: SetDParam(0, STR_019D_AIRCRAFT);     break;
-						default: NOT_REACHED();
-					}
+					SetDParam(0, _vehicle_type_names[v->type - 0x10]);
 					SetDParam(1, v->unitnumber);
 					AddNewsItem(STR_ORDER_REFIT_FAILED, NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0), v->index, 0);
 				}