(svn r924) Use RailVehInfo() instead of &_rail_vehicle_info[]

This commit is contained in:
tron
2004-12-04 07:41:37 +00:00
parent aa183e35d8
commit d036559e0e
2 changed files with 15 additions and 17 deletions

View File

@@ -185,7 +185,7 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
int sel_eng;
sel_eng = WP(w,buildtrain_d).sel_engine;
if (sel_eng != -1)
DoCommandP(w->window_number, sel_eng, 0, (_rail_vehicle_info[sel_eng].flags & RVI_WAGON) ? CcBuildWagon : CcBuildLoco, CMD_BUILD_RAIL_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE));
DoCommandP(w->window_number, sel_eng, 0, (RailVehInfo(sel_eng)->flags & RVI_WAGON) ? CcBuildWagon : CcBuildLoco, CMD_BUILD_RAIL_VEHICLE | CMD_MSG(STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE));
} break;
case 6:
WP(w,buildtrain_d).rename_engine = WP(w,buildtrain_d).sel_engine;
@@ -912,9 +912,7 @@ static void TrainDetailsCargoTab(Vehicle *v, int x, int y)
static void TrainDetailsInfoTab(Vehicle *v, int x, int y)
{
const RailVehicleInfo *rvi;
rvi = &_rail_vehicle_info[v->engine_type];
const RailVehicleInfo *rvi = RailVehInfo(v->engine_type);
if (!(rvi->flags & RVI_WAGON)) {
SetDParam(0, GetCustomEngineName(v->engine_type));