src/vehicle.cpp
changeset 6478 817c29f1882b
parent 6474 24e7ceeb25f5
child 6479 b228a94a1832
equal deleted inserted replaced
6477:c0add302a009 6478:817c29f1882b
  2690 		max(_old_vehicle_coords.bottom,v->bottom_coord)+1
  2690 		max(_old_vehicle_coords.bottom,v->bottom_coord)+1
  2691 	);
  2691 	);
  2692 }
  2692 }
  2693 
  2693 
  2694 /* returns true if staying in the same tile */
  2694 /* returns true if staying in the same tile */
  2695 bool GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp)
  2695 void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp)
  2696 {
  2696 {
  2697 	static const int8 _delta_coord[16] = {
  2697 	static const int8 _delta_coord[16] = {
  2698 		-1,-1,-1, 0, 1, 1, 1, 0, /* x */
  2698 		-1,-1,-1, 0, 1, 1, 1, 0, /* x */
  2699 		-1, 0, 1, 1, 1, 0,-1,-1, /* y */
  2699 		-1, 0, 1, 1, 1, 0,-1,-1, /* y */
  2700 	};
  2700 	};
  2704 
  2704 
  2705 	gp->x = x;
  2705 	gp->x = x;
  2706 	gp->y = y;
  2706 	gp->y = y;
  2707 	gp->old_tile = v->tile;
  2707 	gp->old_tile = v->tile;
  2708 	gp->new_tile = TileVirtXY(x, y);
  2708 	gp->new_tile = TileVirtXY(x, y);
  2709 	return gp->old_tile == gp->new_tile;
       
  2710 }
  2709 }
  2711 
  2710 
  2712 static const Direction _new_direction_table[] = {
  2711 static const Direction _new_direction_table[] = {
  2713 	DIR_N , DIR_NW, DIR_W ,
  2712 	DIR_N , DIR_NW, DIR_W ,
  2714 	DIR_NE, DIR_SE, DIR_SW,
  2713 	DIR_NE, DIR_SE, DIR_SW,