roadveh_cmd.c
changeset 3184 118a520164e4
parent 3169 3761fbfeb1d1
child 3186 4317b5b295c4
equal deleted inserted replaced
3183:90c676e6a50d 3184:118a520164e4
    16 #include "pathfind.h"
    16 #include "pathfind.h"
    17 #include "npf.h"
    17 #include "npf.h"
    18 #include "player.h"
    18 #include "player.h"
    19 #include "sound.h"
    19 #include "sound.h"
    20 #include "depot.h"
    20 #include "depot.h"
       
    21 #include "tunnel_map.h"
    21 #include "vehicle_gui.h"
    22 #include "vehicle_gui.h"
    22 #include "newgrf_engine.h"
    23 #include "newgrf_engine.h"
    23 
    24 
    24 static const uint16 _roadveh_images[63] = {
    25 static const uint16 _roadveh_images[63] = {
    25 	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
    26 	0xCD4, 0xCDC, 0xCE4, 0xCEC, 0xCF4, 0xCFC, 0xD0C, 0xD14,
  1252 		if (RoadVehFindCloseTo(v, gp.x, gp.y, v->direction) != NULL) {
  1253 		if (RoadVehFindCloseTo(v, gp.x, gp.y, v->direction) != NULL) {
  1253 			v->cur_speed = 0;
  1254 			v->cur_speed = 0;
  1254 			return;
  1255 			return;
  1255 		}
  1256 		}
  1256 
  1257 
  1257 		if (IsTileType(gp.new_tile, MP_TUNNELBRIDGE) &&
  1258 		if (IsTunnelTile(gp.new_tile) &&
  1258 				GB(_m[gp.new_tile].m5, 4, 4) == 0 &&
       
  1259 				VehicleEnterTile(v, gp.new_tile, gp.x, gp.y) & 4) {
  1259 				VehicleEnterTile(v, gp.new_tile, gp.x, gp.y) & 4) {
  1260 			//new_dir = RoadGetNewDirection(v, gp.x, gp.y)
  1260 			//new_dir = RoadGetNewDirection(v, gp.x, gp.y)
  1261 			v->cur_image = GetRoadVehImage(v, v->direction);
  1261 			v->cur_image = GetRoadVehImage(v, v->direction);
  1262 			UpdateRoadVehDeltaXY(v);
  1262 			UpdateRoadVehDeltaXY(v);
  1263 			SetRoadVehPosition(v,gp.x,gp.y);
  1263 			SetRoadVehPosition(v,gp.x,gp.y);