src/build_vehicle_gui.cpp
changeset 6070 e5a6d7b94c63
parent 6068 286d4dfa1d39
child 6073 d8dae377c879
equal deleted inserted replaced
6069:8274f3327a2f 6070:e5a6d7b94c63
   533 
   533 
   534 	switch (e->type) {
   534 	switch (e->type) {
   535 		case VEH_Train: {
   535 		case VEH_Train: {
   536 			const RailVehicleInfo *rvi = RailVehInfo(engine_number);
   536 			const RailVehicleInfo *rvi = RailVehInfo(engine_number);
   537 
   537 
       
   538 			refitable = (EngInfo(engine_number)->refit_mask != 0) && (rvi->capacity > 0);
       
   539 
   538 			if (rvi->flags & RVI_WAGON) {
   540 			if (rvi->flags & RVI_WAGON) {
   539 				y = DrawRailWagonPurchaseInfo(x, y, engine_number, rvi);
   541 				y = DrawRailWagonPurchaseInfo(x, y, engine_number, rvi);
   540 				refitable = true;
       
   541 			} else {
   542 			} else {
   542 				y = DrawRailEnginePurchaseInfo(x, y, engine_number, rvi, e);
   543 				y = DrawRailEnginePurchaseInfo(x, y, engine_number, rvi, e);
   543 				refitable = (rvi->capacity > 0);
       
   544 			}
   544 			}
   545 
   545 
   546 			/* Cargo type + capacity, or N/A */
   546 			/* Cargo type + capacity, or N/A */
   547 			if (rvi->capacity == 0) {
   547 			if (rvi->capacity == 0) {
   548 				SetDParam(0, CT_INVALID);
   548 				SetDParam(0, CT_INVALID);
   549 				SetDParam(2, STR_EMPTY);
   549 				SetDParam(2, STR_EMPTY);
   550 			} else {
   550 			} else {
   551 				int multihead = (rvi->flags & RVI_MULTIHEAD ? 1 : 0);
   551 				int multihead = (rvi->flags & RVI_MULTIHEAD ? 1 : 0);
   552 				bool refittable = (EngInfo(engine_number)->refit_mask != 0);
       
   553 
   552 
   554 				SetDParam(0, rvi->cargo_type);
   553 				SetDParam(0, rvi->cargo_type);
   555 				SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
   554 				SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
   556 				SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
   555 				SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
   557 			}
   556 			}
   558 			DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0);
   557 			DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0);
   559 			y += 10;
   558 			y += 10;
   560 		}
   559 		}
   561 			break;
   560 			break;