(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]

This commit is contained in:
tron
2005-06-07 18:13:49 +00:00
parent d0cdb45b6c
commit fa8f46c0b7
16 changed files with 59 additions and 54 deletions

View File

@@ -26,7 +26,7 @@ int _traininfo_vehicle_pitch = 0;
void DrawTrainEnginePurchaseInfo(int x, int y, EngineID engine_number)
{
const RailVehicleInfo *rvi = RailVehInfo(engine_number);
Engine *e = &_engines[engine_number];
const Engine* e = GetEngine(engine_number);
int multihead = (rvi->flags&RVI_MULTIHEAD?1:0);
YearMonthDay ymd;
ConvertDayToYMD(&ymd, e->intro_date);
@@ -157,7 +157,7 @@ static void engine_drawing_loop(int *x, int *y, int *pos, int *sel,
int i;
for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
const Engine *e = DEREF_ENGINE(i);
const Engine *e = GetEngine(i);
const RailVehicleInfo *rvi = RailVehInfo(i);
if (e->railtype != railtype || !(rvi->flags & RVI_WAGON) != is_engine ||
@@ -191,7 +191,7 @@ static void NewRailVehicleWndProc(Window *w, WindowEvent *e)
int i;
for (i = 0; i < NUM_TRAIN_ENGINES; i++) {
const Engine *e = DEREF_ENGINE(i);
const Engine *e = GetEngine(i);
if (e->railtype == railtype
&& HASBIT(e->player_avail, _local_player))
count++;