(svn r16391) -Codechange: use Train instead of Vehicle where appropriate.

This commit is contained in:
rubidium
2009-05-22 22:22:46 +00:00
parent 7a37220881
commit 80e94b9bb1
33 changed files with 429 additions and 387 deletions

View File

@@ -18,6 +18,7 @@
#include "newgrf_text.h"
#include "station_map.h"
#include "roadveh.h"
#include "train.h"
#include "depot_base.h"
#include "group_gui.h"
#include "strings_func.h"
@@ -1468,7 +1469,7 @@ struct VehicleDetailsWindow : Window {
SetDParam(1, v->u.rail.cached_power);
SetDParam(0, v->u.rail.cached_weight);
SetDParam(3, v->u.rail.cached_max_te / 1000);
DrawString(2, this->width - 2, 25, (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && v->u.rail.railtype != RAILTYPE_MAGLEV) ?
DrawString(2, this->width - 2, 25, (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && ((Train *)v)->u.rail.railtype != RAILTYPE_MAGLEV) ?
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED_MAX_TE :
STR_VEHICLE_INFO_WEIGHT_POWER_MAX_SPEED);
break;
@@ -1948,7 +1949,7 @@ struct VehicleViewWindow : Window {
} else { // no train
str = STR_VEHICLE_STATUS_STOPPED;
}
} else if (v->type == VEH_TRAIN && HasBit(v->u.rail.flags, VRF_TRAIN_STUCK)) {
} else if (v->type == VEH_TRAIN && HasBit(((Train *)v)->u.rail.flags, VRF_TRAIN_STUCK)) {
str = STR_TRAIN_STUCK;
} else { // vehicle is in a "normal" state, show current order
switch (v->current_order.GetType()) {