Skip to content

Commit

Permalink
Hotfix: Trams are using regular roads.
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorPhilipp committed Mar 22, 2017
1 parent 48810a4 commit dc99ae8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions TLM/TLM/Custom/AI/CustomPassengerCarAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@ public bool CustomStartPathFind(ushort vehicleID, ref Vehicle vehicleData, Vecto
return false;
}

public static bool FindParkingSpaceInVicinity(Vector3 targetPos, VehicleInfo vehicleInfo, ushort homeId, out ExtParkingSpaceLocation parkingSpaceLocation, out ushort parkingSpaceLocationId, out Vector3 parkPos, out Quaternion parkRot, out float parkOffset) {
return FindParkingSpaceInVicinity(targetPos, vehicleInfo, homeId, out parkingSpaceLocation, out parkingSpaceLocationId, out parkPos, out parkRot, out parkOffset);
}

public static bool FindParkingSpaceInVicinity(Vector3 targetPos, VehicleInfo vehicleInfo, ushort homeId, ushort vehicleId, out ExtParkingSpaceLocation parkingSpaceLocation, out ushort parkingSpaceLocationId, out Vector3 parkPos, out Quaternion parkRot, out float parkOffset) {
Vector3 roadParkPos;
Quaternion roadParkRot;
Expand Down
6 changes: 3 additions & 3 deletions TLM/TLM/Custom/PathFinding/CustomPathFind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ private void ProcessItemMain(uint unitId, BufferItem item, ref NetSegment prevSe
// a simple transition is (1) no junction, (2) no transition and (3) where lane count is equal
//bool nextIsSimpleTransition = !nextIsTransition && !nextIsRealJunction && nextSegmentInfo.m_lanes.Length == prevSegmentInfo.m_lanes.Length;

if (/*!isStrictLaneArrowPolicyEnabled || */nextIsUntouchable) {
if (_extVehicleType == null || (prevLane.m_vehicleType & VehicleInfo.VehicleType.Car) == VehicleInfo.VehicleType.None || (_extVehicleType & ExtVehicleType.RoadVehicle) == ExtVehicleType.None || nextIsUntouchable) {
// coming from an untouchable segment. do not apply our AI

#if DEBUGPF
Expand Down Expand Up @@ -2095,7 +2095,7 @@ private bool ProcessItemCosts(bool debug, BufferItem item, ushort targetNode, us
}

// 3
private bool ProcessItemCosts(bool allowAdvancedAI, bool obeyLaneArrows, LaneChangingCostCalculationMode laneChangingCostCalculationMode, bool debug, BufferItem item, ushort targetNodeId, ushort nextSegmentId, ref NetSegment prevSegment, ref NetSegment nextSegment, ref int laneIndexFromInner, byte connectOffset, bool enableVehicle, bool enablePedestrian, int? forceLaneIndex, uint? forceLaneId, byte? forcedLaneDist, out bool foundForced) {
private bool ProcessItemCosts(bool allowAdvancedAI, bool obeyStockLaneArrows, LaneChangingCostCalculationMode laneChangingCostCalculationMode, bool debug, BufferItem item, ushort targetNodeId, ushort nextSegmentId, ref NetSegment prevSegment, ref NetSegment nextSegment, ref int laneIndexFromInner, byte connectOffset, bool enableVehicle, bool enablePedestrian, int? forceLaneIndex, uint? forceLaneId, byte? forcedLaneDist, out bool foundForced) {

#if DEBUGPF
/*if (_conf.DebugSwitches[0])
Expand Down Expand Up @@ -2630,7 +2630,7 @@ private bool ProcessItemCosts(bool allowAdvancedAI, bool obeyLaneArrows, LaneCha
if (!aiActivated) {
// NON-STOCK CODE END //

if (obeyLaneArrows) { // TODO check this
if (obeyStockLaneArrows) { // TODO check this
// this is CO's way of matching lanes between segments
int firstTarget = (int)netManager.m_lanes.m_buffer[curLaneId].m_firstTarget;
int lastTarget = (int)netManager.m_lanes.m_buffer[curLaneId].m_lastTarget;
Expand Down

0 comments on commit dc99ae8

Please sign in to comment.