From 59dc8080e963bf11b4b15e683dbb7c531759fdb0 Mon Sep 17 00:00:00 2001 From: krzychu124 Date: Wed, 22 Mar 2023 19:42:11 +0100 Subject: [PATCH 1/2] Compatibility patch --- TLM/TLM/Custom/PathFinding/CustomPathFind.cs | 76 ++++++++++--------- .../Manager/Impl/AdvancedParkingManager.cs | 1 + .../Manager/Impl/ExtCitizenInstanceManager.cs | 5 ++ TLM/TLM/Manager/Impl/ExtPathManager.cs | 28 +++++++ .../LaneConnectionSubManager.cs | 3 + .../Manager/Impl/VehicleBehaviorManager.cs | 1 + .../Connection/TouristAIConnection.cs | 2 +- .../_TouristAI/GetVehicleInfoPatch.cs | 2 +- .../Util/Extensions/NetSegmentExtensions.cs | 4 +- TLM/TMPE.API/Manager/IExtPathManager.cs | 8 ++ 10 files changed, 92 insertions(+), 38 deletions(-) diff --git a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs index 087918fc4..64ab98b6d 100644 --- a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs +++ b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs @@ -1293,11 +1293,14 @@ private struct BufferItem { queueItem_.pathType == ExtPathType.DrivingOnly) // NON-STOCK CODE END ) { - bool isPrevSegmentPedZoneRoad = prevSegmentInfo.IsPedestrianZoneOrPublicTransportRoad(); for (int i = 0; i < 8; i++) { ushort nextPedZoneSegmentId = nextNode.GetSegment(i); - if (nextPedZoneSegmentId != 0 && nextPedZoneSegmentId != prevSegmentId && isPrevSegmentPedZoneRoad) { + if (nextPedZoneSegmentId != 0 && nextPedZoneSegmentId != prevSegmentId) + { + ref NetSegment nextPedZoneSegment = ref nextPedZoneSegmentId.ToSegment(); + if (nextPedZoneSegment.Info.IsPedestrianZoneOrPublicTransportRoad()) + { ProcessItemCosts( #if DEBUG isLogEnabled, @@ -1312,7 +1315,7 @@ private struct BufferItem { ref nextNode, false, nextPedZoneSegmentId, - ref nextPedZoneSegmentId.ToSegment(), + ref nextPedZoneSegment, ref prevRelSimilarLaneIndex, connectOffset, false, @@ -1320,6 +1323,7 @@ private struct BufferItem { } } } + } } else { if (isLogEnabled) { DebugLog( @@ -2290,10 +2294,9 @@ private struct BufferItem { Randomizer randomizer = new Randomizer(pathFindIndex_ ^ nextLaneId); newDistance *= randomizer.Int32(10000U) * (1f / 1000f); } - nextItem.ComparisonValue = comparisonValue + - (newDistance / + float currentComparisonValue = (newDistance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_)); - nextItem.Duration = duration + (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f)); + float currentDuration = (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f)); nextItem.Direction = (nextSegment.m_flags & NetSegment.Flags.Invert) != NetSegment.Flags.None @@ -2331,9 +2334,8 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += - nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); - nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed; + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); + currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed; } if (nextLaneId == startLaneB_) { @@ -2367,11 +2369,12 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += - nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); - nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed; + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); + currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed; } + nextItem.ComparisonValue = comparisonValue + currentComparisonValue; + nextItem.Duration = duration + currentDuration; nextItem.LaneId = nextLaneId; nextItem.LanesUsed = item.LanesUsed | nextLaneInfo.m_laneType; nextItem.VehiclesUsed = item.VehiclesUsed | nextLaneInfo.m_vehicleType; @@ -2692,6 +2695,7 @@ private struct BufferItem { NetInfo.LaneType allowedLaneTypes = laneTypes_; VehicleInfo.VehicleType allowedVehicleTypes = vehicleTypes_; + VehicleInfo.VehicleCategory currentVehicleCategory = vehicleCategory_; if (!enableVehicle) { allowedVehicleTypes &= VehicleInfo.VehicleType.Bicycle; if (allowedVehicleTypes == VehicleInfo.VehicleType.None) { @@ -2700,6 +2704,10 @@ private struct BufferItem { } } + if (ignoreBlocked_) { + currentVehicleCategory = VehicleInfo.VehicleCategory.All; + } + if (!enablePedestrian) { allowedLaneTypes &= ~NetInfo.LaneType.Pedestrian; } @@ -2782,7 +2790,6 @@ private struct BufferItem { } #endif - var currentVehicleCategory = vehicleCategory_; // NON-STOCK CODE END for (; nextLaneIndex <= maxNextLaneIndex && nextLaneId != 0; nextLaneIndex++) { NetInfo.Lane nextLaneInfo = nextSegmentInfo.m_lanes[nextLaneIndex]; @@ -2934,8 +2941,8 @@ private struct BufferItem { } // NON-STOCK CODE END - nextItem.ComparisonValue = comparisonValue + transitionCostOverMeanMaxSpeed; - nextItem.Duration = duration + transitionCost / ((prevMaxSpeed + nextMaxSpeed) * 0.5f); + float currentComparisonValue = transitionCostOverMeanMaxSpeed; + float currentDuration = transitionCost / ((prevMaxSpeed + nextMaxSpeed) * 0.5f); nextItem.Direction = nextDir; if (nextLaneId == startLaneA_) { @@ -2972,10 +2979,10 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextLaneSpeed * maxLength_); - nextItem.Duration += + currentDuration += nextOffset * nextSegment.m_averageLength / nextLaneSpeed; } @@ -3013,10 +3020,10 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextLaneSpeed * maxLength_); - nextItem.Duration += + currentDuration += nextOffset * nextSegment.m_averageLength / nextLaneSpeed; } @@ -3026,7 +3033,7 @@ private struct BufferItem { (nextLaneInfo.m_laneType & (NetInfo.LaneType.Vehicle | NetInfo.LaneType.TransportVehicle)) != NetInfo.LaneType.None) { - nextItem.ComparisonValue += 0.1f; + currentComparisonValue += 0.1f; blocked = true; if ((allowedVehicleTypes & VehicleInfo.VehicleType.Plane) != 0) { @@ -3063,7 +3070,7 @@ private struct BufferItem { } } - nextItem.ComparisonValue += adjustedBaseLength; + currentComparisonValue += adjustedBaseLength; if (isLogEnabled) { DebugLog( @@ -3084,7 +3091,7 @@ private struct BufferItem { // apply lane distance factor float adjustedBaseLength = baseLength; adjustedBaseLength *= 1 + laneDist; - nextItem.ComparisonValue += adjustedBaseLength; + currentComparisonValue += adjustedBaseLength; if (isLogEnabled) { DebugLog( @@ -3111,7 +3118,7 @@ private struct BufferItem { int lastTarget = nextLane.m_lastTarget; if (laneIndexFromInner < firstTarget || laneIndexFromInner >= lastTarget) { - nextItem.ComparisonValue += + currentComparisonValue += Mathf.Max(1f, (transitionCost * 3f) - 3f) / ((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_); } @@ -3134,7 +3141,7 @@ private struct BufferItem { if (!transportVehicle_ && nextLaneInfo.m_laneType == NetInfo.LaneType.TransportVehicle) { - nextItem.ComparisonValue += + currentComparisonValue += 20f / ((prevMaxSpeed + nextMaxSpeed) * 0.5f * maxLength_); } } @@ -3151,9 +3158,11 @@ private struct BufferItem { if ((nextLaneInfo.vehicleCategory & VehicleInfo.VehicleCategory.PublicTransportRoad) != 0 && (nextLaneInfo.vehicleCategory & ~(VehicleInfo.VehicleCategory.Bus | VehicleInfo.VehicleCategory.Trolleybus | VehicleInfo.VehicleCategory.Taxi)) == 0) { - nextItem.ComparisonValue -= baseLength * 0.25f; + currentComparisonValue -= baseLength * 0.25f; } + nextItem.ComparisonValue = comparisonValue + currentComparisonValue; + nextItem.Duration = duration + currentDuration; AddBufferItem( #if DEBUG isLogEnabled, @@ -3437,10 +3446,9 @@ private struct BufferItem { var nextMaxSpeed = nextLaneInfo.m_speedLimit; #endif - nextItem.ComparisonValue = comparisonValue + - distance / + float currentComparisonValue = distance / ((prevMaxSpeed + nextMaxSpeed) * 0.25f * maxLength_); - nextItem.Duration = duration + (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f)); + float currentDuration = (distance / ((prevMaxSpeed + nextMaxSpeed) * 0.5f)); nextItem.Direction = (nextSegment.m_flags & NetSegment.Flags.Invert) != NetSegment.Flags.None @@ -3477,9 +3485,8 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetA_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += - nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); - nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed; + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); + currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed; } if (nextLaneId == startLaneB_) { @@ -3511,11 +3518,12 @@ private struct BufferItem { float nextOffset = Mathf.Abs(nextItem.Position.m_offset - startOffsetB_) * BYTE_TO_FLOAT_OFFSET_CONVERSION_FACTOR; - nextItem.ComparisonValue += - nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); - nextItem.Duration += nextOffset * nextSegment.m_averageLength / nextSpeed; + currentComparisonValue += nextOffset * nextSegment.m_averageLength / (nextSpeed * maxLength_); + currentDuration += nextOffset * nextSegment.m_averageLength / nextSpeed; } + nextItem.ComparisonValue = comparisonValue + currentComparisonValue; + nextItem.Duration = duration + currentDuration; nextItem.LaneId = nextLaneId; nextItem.LanesUsed = item.LanesUsed | nextLaneInfo.m_laneType; nextItem.VehiclesUsed = item.VehiclesUsed | nextLaneInfo.m_vehicleType; diff --git a/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs b/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs index 4387fe7ad..1fa851197 100644 --- a/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs +++ b/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs @@ -1952,6 +1952,7 @@ private ExtSoftPathState false, false, GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance, + false, out endPathPos)) { calculateEndPos = false; } diff --git a/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs b/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs index bc328e663..88ea6aa3f 100644 --- a/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs +++ b/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs @@ -927,6 +927,7 @@ bool citizenDebug false, false, parkingAiConf.MaxBuildingToPedestrianLaneDistance, + false, out parkedVehiclePathPos); } @@ -977,6 +978,7 @@ bool citizenDebug allowUnderground, false, parkingAiConf.MaxBuildingToPedestrianLaneDistance, + false, out startPosA); } else { foundStartPos = FindPathPosition( @@ -1152,6 +1154,7 @@ bool citizenDebug SavedGameOptions.Instance.parkingAI ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + false, out PathUnit.Position posA, out PathUnit.Position posB, out float distA, @@ -1171,6 +1174,7 @@ bool citizenDebug SavedGameOptions.Instance.parkingAI ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + false, out posA, out posB, out distA, @@ -1191,6 +1195,7 @@ bool citizenDebug SavedGameOptions.Instance.parkingAI ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + false, out posA, out posB, out distA, diff --git a/TLM/TLM/Manager/Impl/ExtPathManager.cs b/TLM/TLM/Manager/Impl/ExtPathManager.cs index 604463a81..34c56e671 100644 --- a/TLM/TLM/Manager/Impl/ExtPathManager.cs +++ b/TLM/TLM/Manager/Impl/ExtPathManager.cs @@ -58,6 +58,7 @@ public class ExtPathManager maxDistance: SavedGameOptions.Instance.parkingAI ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + excludeLaneWidth: false, pathPosA: out PathUnit.Position posA, pathPosB: out _, distanceSqrA: out float distA, @@ -78,6 +79,7 @@ public class ExtPathManager SavedGameOptions.Instance.parkingAI ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + false, out posA, out _, out distA, @@ -99,6 +101,7 @@ public class ExtPathManager ? GlobalConfig .Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, + false, out posA, out _, out distA, @@ -118,6 +121,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -130,6 +134,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPos); } @@ -143,6 +148,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -156,6 +162,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPos); } @@ -169,6 +176,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -183,6 +191,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPos, out PathUnit.Position _, out float _, @@ -200,6 +209,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos ) { return FindPathPositionWithSpiralLoop( @@ -215,6 +225,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPos, out PathUnit.Position _, out float _, @@ -230,6 +241,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -245,6 +257,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPosA, out pathPosB, out distanceSqrA, @@ -261,6 +274,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -278,6 +292,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPosA, out pathPosB, out distanceSqrA, @@ -294,6 +309,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -311,6 +327,7 @@ public class ExtPathManager allowUnderground, requireConnect, maxDistance, + excludeLaneWidth, out pathPosA, out pathPosB, out distanceSqrA, @@ -329,6 +346,7 @@ public class ExtPathManager bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -456,6 +474,11 @@ public class ExtPathManager out float laneOffsetB)) { float dist = Vector3.SqrMagnitude(position - posA); + if (excludeLaneWidth) + { + dist = Mathf.Max(0f, Mathf.Sqrt(dist) - segmentInfo.m_lanes[laneIndexA].m_width * 0.5f); + dist *= dist; + } if (secondaryPosition.HasValue) { dist += Vector3.SqrMagnitude(secondaryPosition.Value - posA); } @@ -473,6 +496,11 @@ public class ExtPathManager myDistanceSqrA = dist; dist = Vector3.SqrMagnitude(position - posB); + if (excludeLaneWidth) + { + dist = Mathf.Max(0f, Mathf.Sqrt(dist) - segmentInfo.m_lanes[laneIndexA].m_width * 0.5f); + dist *= dist; + } if (secondaryPosition.HasValue) { dist += Vector3.SqrMagnitude( secondaryPosition.Value - posB); diff --git a/TLM/TLM/Manager/Impl/LaneConnection/LaneConnectionSubManager.cs b/TLM/TLM/Manager/Impl/LaneConnection/LaneConnectionSubManager.cs index 5749cef2c..d5ddc7971 100644 --- a/TLM/TLM/Manager/Impl/LaneConnection/LaneConnectionSubManager.cs +++ b/TLM/TLM/Manager/Impl/LaneConnection/LaneConnectionSubManager.cs @@ -303,6 +303,9 @@ public class LaneConnectionSubManager : for (int i = 0; i < 8; ++i) { ushort segmentId = node.GetSegment(i); + if (segmentId == 0) + continue; + RoutingManager.Instance.RequestRecalculation(segmentId); if (TMPELifecycle.Instance.MayPublishSegmentChanges()) { ExtSegmentManager.Instance.PublishSegmentChanges(segmentId); diff --git a/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs b/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs index d43ce5e66..57faadb86 100644 --- a/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs +++ b/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs @@ -897,6 +897,7 @@ bool citizenDebug allowUnderground, false, 32f, + false, out startPosA, out startPosB, out sqrDistA, diff --git a/TLM/TLM/Patch/_CitizenAI/_TouristAI/Connection/TouristAIConnection.cs b/TLM/TLM/Patch/_CitizenAI/_TouristAI/Connection/TouristAIConnection.cs index b7a059002..b2a46512c 100644 --- a/TLM/TLM/Patch/_CitizenAI/_TouristAI/Connection/TouristAIConnection.cs +++ b/TLM/TLM/Patch/_CitizenAI/_TouristAI/Connection/TouristAIConnection.cs @@ -2,7 +2,7 @@ namespace TrafficManager.Patch._CitizenAI._TouristAI.Connection { using System; using UnityEngine; - public delegate int GetTaxiProbabilityDelegate(TouristAI instance); + public delegate int GetTaxiProbabilityDelegate(TouristAI instance, ushort instanceID, ref CitizenInstance citizenData); public delegate int GetBikeProbabilityDelegate(TouristAI instance); public delegate int GetCarProbabilityDelegate(TouristAI instance, Vector3 position); public delegate int GetElectricCarProbabilityDelegate(TouristAI instance, Citizen.Wealth wealth); diff --git a/TLM/TLM/Patch/_CitizenAI/_TouristAI/GetVehicleInfoPatch.cs b/TLM/TLM/Patch/_CitizenAI/_TouristAI/GetVehicleInfoPatch.cs index f850b77d1..0b1cd1f75 100644 --- a/TLM/TLM/Patch/_CitizenAI/_TouristAI/GetVehicleInfoPatch.cs +++ b/TLM/TLM/Patch/_CitizenAI/_TouristAI/GetVehicleInfoPatch.cs @@ -95,7 +95,7 @@ public class GetVehicleInfoPatch { } else { carProb = GetCarProbability(__instance, citizenData.m_frame1.m_position); bikeProb = GetBikeProbability(__instance); - taxiProb = GetTaxiProbability(__instance); + taxiProb = GetTaxiProbability(__instance, instanceID, ref citizenData); } Randomizer randomizer = new Randomizer(citizenData.m_citizen); diff --git a/TLM/TLM/Util/Extensions/NetSegmentExtensions.cs b/TLM/TLM/Util/Extensions/NetSegmentExtensions.cs index 58beb2f50..9c60dbe32 100644 --- a/TLM/TLM/Util/Extensions/NetSegmentExtensions.cs +++ b/TLM/TLM/Util/Extensions/NetSegmentExtensions.cs @@ -170,8 +170,8 @@ public static class NetSegmentExtensions { VehicleInfo.VehicleType vehicleType) { #if DEBUG - AssertNotNone(laneType, nameof(laneType)); - AssertNotNone(vehicleType, nameof(vehicleType)); + // AssertNotNone(laneType, nameof(laneType)); + // AssertNotNone(vehicleType, nameof(vehicleType)); #endif NetInfo segmentInfo = netSegment.Info; diff --git a/TLM/TMPE.API/Manager/IExtPathManager.cs b/TLM/TMPE.API/Manager/IExtPathManager.cs index 8920b9e83..ff4ed20bc 100644 --- a/TLM/TMPE.API/Manager/IExtPathManager.cs +++ b/TLM/TMPE.API/Manager/IExtPathManager.cs @@ -16,6 +16,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, ItemClass.Service service, @@ -27,6 +28,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -39,6 +41,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -52,6 +55,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -63,6 +67,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -78,6 +83,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -93,6 +99,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -110,6 +117,7 @@ public interface IExtPathManager { bool allowUnderground, bool requireConnect, float maxDistance, + bool excludeLaneWidth, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, From 18ba0b38207a1687bed75e1c54aebfbab707cada Mon Sep 17 00:00:00 2001 From: krzychu124 Date: Wed, 22 Mar 2023 19:49:12 +0100 Subject: [PATCH 2/2] Version bump to 11.7.4.0 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ README.md | 3 ++- TLM/SharedAssemblyInfo.cs | 2 +- TLM/TLM/Resources/whats_new.txt | 15 +++++++++++---- TLM/TLM/UI/WhatsNew/WhatsNew.cs | 2 +- TLM/TLM/Util/VersionUtil.cs | 4 ++-- 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f28932e95..57533fdce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,30 @@ This changelog includes all versions and major variants of the mod going all the > Date format: dd/mm/yyyy +#### TM:PE V[11.7.4.0](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.3.0...11.7.3.1) STABLE, 22/03/2022 + +- [Meta] Compatibility patch for the game update 1.16.1-f2 +- [New] Prevent the user from setting invalid Lane Arrows, update arrows if lane connections exist #368, #1724 (krzychu124) +- [Fixed] Mouse wheel scroll is changing values if dropdown popup is closed #1733 (krzychu124) +- [Fixed] Building Color change performance improvements #1725 (krzychu124) +- [Fixed] Reduced memory pressure/garbage generation in simulation critical paths #1731 (krzychu124) +- [Updated] Translation update for Arabic, Czech, English, French, Indonesian Italian, Korean, Polish, Portuguese, Romanian, Spanish, Thai, Turkish and Ukrainian +- [Updated] Minor improvements in storing mod default values #1702 (kianzarrin) +- [Mod] Improved compatibility with More Path Units +- [Steam] [TM:PE v11 STABLE](https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252) + +#### TM:PE V11.7.4.0 TEST, 22/03/2022 + +- [Meta] Compatibility patch for the game update 1.16.1-f2 +- [New] Prevent the user from setting invalid Lane Arrows, update arrows if lane connections exist #368, #1724 (krzychu124) +- [Fixed] Mouse wheel scroll is changing values if dropdown popup is closed #1733 (krzychu124) +- [Fixed] Building Color change performance improvements #1725 (krzychu124) +- [Fixed] Reduced memory pressure/garbage generation in simulation critical paths #1731 (krzychu124) +- [Updated] Translation update for Arabic, Czech, English, French, Indonesian Italian, Korean, Polish, Portuguese, Romanian, Spanish, Thai, Turkish and Ukrainian +- [Updated] Minor improvements in storing mod default values #1702 (kianzarrin) +- [Mod] Improved compatibility with More Path Units +- [Steam] [TM:PE v11 TEST](https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785) + #### TM:PE V[11.7.3.1](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.3.0...11.7.3.1) STABLE, 23/12/2022 - [Fixed] Partial detection of Bank vans as service vehicles (krzychu124) diff --git a/README.md b/README.md index 47401d08b..3750966a3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Report a Bug

- + @@ -30,6 +30,7 @@ ## Releases + - [TM:PE v11 STABLE](https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252) (fully tested releases) - [TM:PE v11 TEST](https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785) (latest beta test releases) - [Download Binaries](https://github.com/CitiesSkylinesMods/TMPE/releases) (for non-Steam users) diff --git a/TLM/SharedAssemblyInfo.cs b/TLM/SharedAssemblyInfo.cs index b7a4568a5..50ad677fb 100644 --- a/TLM/SharedAssemblyInfo.cs +++ b/TLM/SharedAssemblyInfo.cs @@ -20,4 +20,4 @@ // Minor Version // Build Number // Revision -[assembly: AssemblyVersion("11.7.3.*")] +[assembly: AssemblyVersion("11.7.4.*")] diff --git a/TLM/TLM/Resources/whats_new.txt b/TLM/TLM/Resources/whats_new.txt index 80316d931..a0b1155cb 100644 --- a/TLM/TLM/Resources/whats_new.txt +++ b/TLM/TLM/Resources/whats_new.txt @@ -1,6 +1,13 @@ -[Version] 11.7.3.1 -[Released] Dec 23th 2022 -[Link] tmpe-v11731-stable-23122022 +[Version] 11.7.4.0 +[Released] Mar 22nd 2023 +[Link] tmpe-v11740-stable-22032023 [Stable] -[Fixed] Partial detection of Bank vans as service vehicle +[Meta] Compatibility patch for the game update 1.16.1-f2 +[New] Prevent the user from setting invalid Lane Arrows, update arrows if lane connections exist #368 #1724 (krzychu124) +[Fixed] Mouse wheel scroll is changing values if dropdown popup is closed #1733 (krzychu124) +[Fixed] Building Color change performance improvements #1725 (krzychu124) +[Fixed] Reduced memory pressure/garbage generation in simulation critical paths #1731 (krzychu124) +[Updated] Translation update for Arabic, Czech, English, French, Indonesian Italian, Korean, Polish, Portuguese, Romanian, Spanish, Thai, Turkish and Ukrainian +[Updated] Minor improvements in storing mod default values #1702 (kianzarrin) +[Mod] Improved compatibility with More Path Units [/Version] \ No newline at end of file diff --git a/TLM/TLM/UI/WhatsNew/WhatsNew.cs b/TLM/TLM/UI/WhatsNew/WhatsNew.cs index 58c18d521..d5e982f50 100644 --- a/TLM/TLM/UI/WhatsNew/WhatsNew.cs +++ b/TLM/TLM/UI/WhatsNew/WhatsNew.cs @@ -11,7 +11,7 @@ namespace TrafficManager.UI.WhatsNew { public class WhatsNew { // bump and update what's new changelogs when new features added - public static readonly Version CurrentVersion = new Version(11,7,3,1); + public static readonly Version CurrentVersion = new Version(11,7,4,0); private const string WHATS_NEW_FILE = "whats_new.txt"; private const string RESOURCES_PREFIX = "TrafficManager.Resources."; diff --git a/TLM/TLM/Util/VersionUtil.cs b/TLM/TLM/Util/VersionUtil.cs index 8e0bd27ac..e418f1a8f 100644 --- a/TLM/TLM/Util/VersionUtil.cs +++ b/TLM/TLM/Util/VersionUtil.cs @@ -35,10 +35,10 @@ public static class VersionUtil { // we could alternatively use BuildConfig.APPLICATION_VERSION because const values are evaluated at compile time. // but I have decided not to do this because I don't want this to happen automatically with a rebuild if // CS updates. these values should be changed manually so as to force us to acknowledge that they have changed. - public const uint EXPECTED_GAME_VERSION_U = 201450256U; + public const uint EXPECTED_GAME_VERSION_U = 201581072U; // see comments for EXPECTED_GAME_VERSION_U. - public static Version ExpectedGameVersion => new Version(1, 16, 0, 3); + public static Version ExpectedGameVersion => new Version(1, 16, 1, 2); public static string ExpectedGameVersionString => BuildConfig.VersionToString(EXPECTED_GAME_VERSION_U, false);