mirror of https://github.com/OpenTTD/OpenTTD
(svn r15374) -Codechange: remove a magic constant.
parent
ef754b8b6d
commit
0cfc402823
|
@ -27,6 +27,7 @@
|
||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "effectvehicle_func.h"
|
#include "effectvehicle_func.h"
|
||||||
#include "elrail_func.h"
|
#include "elrail_func.h"
|
||||||
|
#include "roadveh.h"
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/strings.h"
|
#include "table/strings.h"
|
||||||
|
@ -1537,7 +1538,7 @@ static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int
|
||||||
|
|
||||||
case ROAD_TILE_DEPOT:
|
case ROAD_TILE_DEPOT:
|
||||||
if (v->type == VEH_ROAD &&
|
if (v->type == VEH_ROAD &&
|
||||||
v->u.road.frame == 11 &&
|
v->u.road.frame == RVC_DEPOT_STOP_FRAME &&
|
||||||
_roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == v->u.road.state) {
|
_roadveh_enter_depot_dir[GetRoadDepotDirection(tile)] == v->u.road.state) {
|
||||||
v->u.road.state = RVSB_IN_DEPOT;
|
v->u.road.state = RVSB_IN_DEPOT;
|
||||||
v->vehstatus |= VS_HIDDEN;
|
v->vehstatus |= VS_HIDDEN;
|
||||||
|
|
|
@ -10,6 +10,26 @@
|
||||||
#include "engine_base.h"
|
#include "engine_base.h"
|
||||||
#include "economy_func.h"
|
#include "economy_func.h"
|
||||||
|
|
||||||
|
/** State information about the Road Vehicle controller */
|
||||||
|
enum {
|
||||||
|
RDE_NEXT_TILE = 0x80, ///< We should enter the next tile
|
||||||
|
RDE_TURNED = 0x40, ///< We just finished turning
|
||||||
|
|
||||||
|
/* Start frames for when a vehicle enters a tile/changes its state.
|
||||||
|
* The start frame is different for vehicles that turned around or
|
||||||
|
* are leaving the depot as the do not start at the edge of the tile.
|
||||||
|
* For trams there are a few different start frames as there are two
|
||||||
|
* places where trams can turn. */
|
||||||
|
RVC_DEFAULT_START_FRAME = 0,
|
||||||
|
RVC_TURN_AROUND_START_FRAME = 1,
|
||||||
|
RVC_DEPOT_START_FRAME = 6,
|
||||||
|
RVC_START_FRAME_AFTER_LONG_TRAM = 21,
|
||||||
|
RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16,
|
||||||
|
/* Stop frame for a vehicle in a drive-through stop */
|
||||||
|
RVC_DRIVE_THROUGH_STOP_FRAME = 7,
|
||||||
|
RVC_DEPOT_STOP_FRAME = 11,
|
||||||
|
};
|
||||||
|
|
||||||
enum RoadVehicleSubType {
|
enum RoadVehicleSubType {
|
||||||
RVST_FRONT,
|
RVST_FRONT,
|
||||||
RVST_ARTIC_PART,
|
RVST_ARTIC_PART,
|
||||||
|
|
|
@ -1202,24 +1202,6 @@ static uint RoadFindPathToStop(const Vehicle *v, TileIndex tile)
|
||||||
return dist;
|
return dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum {
|
|
||||||
RDE_NEXT_TILE = 0x80,
|
|
||||||
RDE_TURNED = 0x40,
|
|
||||||
|
|
||||||
/* Start frames for when a vehicle enters a tile/changes its state.
|
|
||||||
* The start frame is different for vehicles that turned around or
|
|
||||||
* are leaving the depot as the do not start at the edge of the tile.
|
|
||||||
* For trams there are a few different start frames as there are two
|
|
||||||
* places where trams can turn. */
|
|
||||||
RVC_DEFAULT_START_FRAME = 0,
|
|
||||||
RVC_TURN_AROUND_START_FRAME = 1,
|
|
||||||
RVC_DEPOT_START_FRAME = 6,
|
|
||||||
RVC_START_FRAME_AFTER_LONG_TRAM = 21,
|
|
||||||
RVC_TURN_AROUND_START_FRAME_SHORT_TRAM = 16,
|
|
||||||
/* Stop frame for a vehicle in a drive-through stop */
|
|
||||||
RVC_DRIVE_THROUGH_STOP_FRAME = 7
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RoadDriveEntry {
|
struct RoadDriveEntry {
|
||||||
byte x, y;
|
byte x, y;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue