Allow drive-through road stops to be one-way

This commit is contained in:
Jonathan G Rennison
2020-10-24 20:39:15 +01:00
parent 3fa92f5d8e
commit 3a75f13874
16 changed files with 333 additions and 50 deletions

View File

@@ -14,6 +14,8 @@
#include "core/pool_type.hpp"
#include "core/bitmath_func.hpp"
#include "vehicle_type.h"
#include "roadveh.h"
#include "road_map.h"
typedef Pool<RoadStop, RoadStopID, 32, 64000> RoadStopPool;
extern RoadStopPool _roadstop_pool;
@@ -134,8 +136,19 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> {
return HasBit((int)dir, 1) ? this->west : this->east;
}
inline const Entry *GetEntry(const RoadVehicle *rv) const {
DiagDirection diag_dir = DirToDiagDir(rv->direction);
return this->GetEntry(rv->overtaking != 0 ? ReverseDiagDir(diag_dir) : diag_dir);
}
inline Entry *GetEntry(const RoadVehicle *rv) {
DiagDirection diag_dir = DirToDiagDir(rv->direction);
return this->GetEntry(rv->overtaking != 0 ? ReverseDiagDir(diag_dir) : diag_dir);
}
void MakeDriveThrough();
void ClearDriveThrough();
void ChangeDriveThroughDisallowedRoadDirections(DisallowedRoadDirections drd);
void Leave(RoadVehicle *rv);
bool Enter(RoadVehicle *rv);