equal
deleted
inserted
replaced
168 } |
168 } |
169 |
169 |
170 static void engine_drawing_loop(int *x, int *y, int *pos, int *sel, |
170 static void engine_drawing_loop(int *x, int *y, int *pos, int *sel, |
171 EngineID* selected_id, RailType railtype, byte show_max, bool is_engine) |
171 EngineID* selected_id, RailType railtype, byte show_max, bool is_engine) |
172 { |
172 { |
173 EngineID i; |
173 EngineID j; |
174 |
174 |
175 for (i = 0; i < NUM_TRAIN_ENGINES; i++) { |
175 for (j = 0; j < NUM_TRAIN_ENGINES; j++) { |
|
176 EngineID i = GetRailVehAtPosition(j); |
176 const Engine *e = GetEngine(i); |
177 const Engine *e = GetEngine(i); |
177 const RailVehicleInfo *rvi = RailVehInfo(i); |
178 const RailVehicleInfo *rvi = RailVehInfo(i); |
178 |
179 |
179 if (!IsCompatibleRail(e->railtype, railtype) || !(rvi->flags & RVI_WAGON) != is_engine || |
180 if (!IsCompatibleRail(e->railtype, railtype) || !(rvi->flags & RVI_WAGON) != is_engine || |
180 !HASBIT(e->player_avail, _local_player)) |
181 !HASBIT(e->player_avail, _local_player)) |