From dc99ae874bde5c19a5f912ba0f011ff0221ada3e Mon Sep 17 00:00:00 2001 From: Victor-Philipp Negoescu Date: Wed, 22 Mar 2017 17:35:45 +0100 Subject: [PATCH] Hotfix: Trams are using regular roads. --- TLM/TLM/Custom/AI/CustomPassengerCarAI.cs | 4 ---- TLM/TLM/Custom/PathFinding/CustomPathFind.cs | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/TLM/TLM/Custom/AI/CustomPassengerCarAI.cs b/TLM/TLM/Custom/AI/CustomPassengerCarAI.cs index 48769aa7..76e5022b 100644 --- a/TLM/TLM/Custom/AI/CustomPassengerCarAI.cs +++ b/TLM/TLM/Custom/AI/CustomPassengerCarAI.cs @@ -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; diff --git a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs index 326e059f..d078c634 100644 --- a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs +++ b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs @@ -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 @@ -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]) @@ -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;