diff --git a/CHANGELOG.md b/CHANGELOG.md index d292cdca7..1c385f148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,16 @@ This changelog includes all versions and major variants of the mod going all the > Date format: dd/mm/yyyy +#### TM:PE V[11.8.0.0](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.5.0...11.8.0.0) STABLE, 12/06/2022 + +- [Meta] Compatibility patch for the game update 1.17.1-f2 +- [Steam] [TM:PE v11 STABLE](https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252) + +#### TM:PE V11.8.0.0 TEST, 12/06/2022 + +- [Meta] Compatibility patch for the game update 1.17.1-f2 +- [Steam] [TM:PE v11 TEST](https://steamcommunity.com/sharedfiles/filedetails/?id=2489276785) + #### TM:PE V[11.7.5.0](https://github.com/CitiesSkylinesMods/TMPE/compare/11.7.4.0...11.7.5.0) STABLE, 24/05/2022 - [Meta] Minor fixes and improvements diff --git a/README.md b/README.md index 8720bf1bf..c29493db4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Report a Bug

- + diff --git a/TLM/SharedAssemblyInfo.cs b/TLM/SharedAssemblyInfo.cs index 9b8b6c50e..9f8106cdc 100644 --- a/TLM/SharedAssemblyInfo.cs +++ b/TLM/SharedAssemblyInfo.cs @@ -20,4 +20,4 @@ // Minor Version // Build Number // Revision -[assembly: AssemblyVersion("11.7.5.*")] +[assembly: AssemblyVersion("11.8.0.*")] diff --git a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs index 64ab98b6d..fdd115d89 100644 --- a/TLM/TLM/Custom/PathFinding/CustomPathFind.cs +++ b/TLM/TLM/Custom/PathFinding/CustomPathFind.cs @@ -996,8 +996,12 @@ private struct BufferItem { prevLaneIndex, item.LaneId, prevLaneInfo); + + if (!(prevMaxSpeed > 0f)) { + prevMaxSpeed = 1f; + } #else - prevMaxSpeed = prevLaneInfo.m_speedLimit; + prevMaxSpeed = !(prevLaneInfo.m_speedLimit > 0f) ? 1f : prevLaneInfo.m_speedLimit; #endif prevLaneSpeed = CalculateLaneSpeed( prevMaxSpeed, @@ -2284,9 +2288,13 @@ private struct BufferItem { nextLaneId, nextLaneInfo); + if (!(nextMaxSpeed > 0f)) { + nextMaxSpeed = 1f; // prevent divide by zero which result in NaN value + } + // NON-STOCK CODE END #else - var nextMaxSpeed = nextLaneInfo.m_speedLimit; + var nextMaxSpeed = !(nextLaneInfo.m_speedLimit > 0f) ? 1f : nextLaneInfo.m_speedLimit; #endif float newDistance = distance; if (!stablePath_ && (nextLaneInfo.m_vehicleType & VehicleInfo.VehicleType.Plane) != VehicleInfo.VehicleType.None) @@ -2704,10 +2712,6 @@ private struct BufferItem { } } - if (ignoreBlocked_) { - currentVehicleCategory = VehicleInfo.VehicleCategory.All; - } - if (!enablePedestrian) { allowedLaneTypes &= ~NetInfo.LaneType.Pedestrian; } @@ -2835,8 +2839,12 @@ private struct BufferItem { nextLaneId, nextLaneInfo); // NON-STOCK CODE END + + if (!(nextMaxSpeed > 0f)) { + nextMaxSpeed = 1f; + } #else - nextMaxSpeed = nextLaneInfo.m_speedLimit; + nextMaxSpeed = !(nextLaneInfo.m_speedLimit > 0f) ? 1f : nextLaneInfo.m_speedLimit; #endif float transitionCostOverMeanMaxSpeed = @@ -3441,6 +3449,10 @@ private struct BufferItem { // NON-STOCK CODE START float nextMaxSpeed = speedLimitManager.GetGameSpeedLimit(nextSegmentId, (byte)nextLaneIndex, nextLaneId, nextLaneInfo); + if (!(nextMaxSpeed > 0f)) { + nextMaxSpeed = 1f; + } + // NON-STOCK CODE END #else var nextMaxSpeed = nextLaneInfo.m_speedLimit; @@ -4041,6 +4053,9 @@ private struct BufferItem { laneTarget_[item.LaneId] = target; } + ///

+ /// Calculated Lane speed based on lane direction and ensures value > 0f + /// private float CalculateLaneSpeed(float maxSpeed, byte startOffset, byte endOffset, @@ -4051,18 +4066,18 @@ private struct BufferItem { : NetInfo.InvertDirection(laneInfo.m_finalDirection); if ((direction & NetInfo.Direction.Avoid) == NetInfo.Direction.None) { - return maxSpeed; + return !(maxSpeed > 0f) ? 1f : maxSpeed; } if (endOffset > startOffset && direction == NetInfo.Direction.AvoidForward) { - return maxSpeed * 0.1f; + return !(maxSpeed > 0f) ? 0.1f : maxSpeed * 0.1f; } if (endOffset < startOffset && direction == NetInfo.Direction.AvoidBackward) { - return maxSpeed * 0.1f; + return !(maxSpeed > 0f) ? 0.1f : maxSpeed * 0.1f; } - return maxSpeed * 0.2f; + return !(maxSpeed > 0f) ? 0.2f : maxSpeed * 0.2f; } private void GetLaneDirection( diff --git a/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs b/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs index bb30d9ca1..fe47e1b6a 100644 --- a/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs +++ b/TLM/TLM/Manager/Impl/AdvancedParkingManager.cs @@ -1953,6 +1953,7 @@ private ExtSoftPathState false, GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance, false, + true, out endPathPos)) { calculateEndPos = false; } diff --git a/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs b/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs index f59b63819..a52ec44ac 100644 --- a/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs +++ b/TLM/TLM/Manager/Impl/ExtCitizenInstanceManager.cs @@ -930,6 +930,7 @@ bool citizenDebug false, parkingAiConf.MaxBuildingToPedestrianLaneDistance, false, + false, out parkedVehiclePathPos); } @@ -981,6 +982,7 @@ bool citizenDebug false, parkingAiConf.MaxBuildingToPedestrianLaneDistance, false, + false, out startPosA); } else { foundStartPos = FindPathPosition( @@ -1157,6 +1159,7 @@ bool citizenDebug ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, false, + true, out PathUnit.Position posA, out PathUnit.Position posB, out float distA, @@ -1177,6 +1180,7 @@ bool citizenDebug ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, false, + true, out posA, out posB, out distA, @@ -1198,6 +1202,7 @@ bool citizenDebug ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, false, + true, out posA, out posB, out distA, diff --git a/TLM/TLM/Manager/Impl/ExtPathManager.cs b/TLM/TLM/Manager/Impl/ExtPathManager.cs index 34c56e671..ef1696222 100644 --- a/TLM/TLM/Manager/Impl/ExtPathManager.cs +++ b/TLM/TLM/Manager/Impl/ExtPathManager.cs @@ -59,6 +59,7 @@ public class ExtPathManager ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, excludeLaneWidth: false, + checkPedestrianStreet: false, pathPosA: out PathUnit.Position posA, pathPosB: out _, distanceSqrA: out float distA, @@ -80,6 +81,7 @@ public class ExtPathManager ? GlobalConfig.Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, false, + checkPedestrianStreet: true, out posA, out _, out distA, @@ -102,6 +104,7 @@ public class ExtPathManager .Instance.ParkingAI.MaxBuildingToPedestrianLaneDistance : 32f, false, + checkPedestrianStreet: true, out posA, out _, out distA, @@ -122,6 +125,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -135,6 +139,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPos); } @@ -149,6 +154,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -163,6 +169,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPos); } @@ -177,6 +184,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos) { return FindPathPositionWithSpiralLoop( position, @@ -192,6 +200,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPos, out PathUnit.Position _, out float _, @@ -210,6 +219,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos ) { return FindPathPositionWithSpiralLoop( @@ -226,6 +236,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPos, out PathUnit.Position _, out float _, @@ -242,6 +253,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -258,6 +270,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPosA, out pathPosB, out distanceSqrA, @@ -275,6 +288,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -293,6 +307,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPosA, out pathPosB, out distanceSqrA, @@ -310,6 +325,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -328,6 +344,7 @@ public class ExtPathManager requireConnect, maxDistance, excludeLaneWidth, + checkPedestrianStreet, out pathPosA, out pathPosB, out distanceSqrA, @@ -347,6 +364,7 @@ public class ExtPathManager bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -448,7 +466,7 @@ public class ExtPathManager if (otherPassed) { // STOCK-CODE START - if (segmentInfo.IsPedestrianZoneOrPublicTransportRoad()) + if (checkPedestrianStreet && segmentInfo.IsPedestrianZoneOrPublicTransportRoad()) { vehicleCategory &= ~segmentInfo.m_vehicleCategories; if ((laneType & NetInfo.LaneType.Pedestrian) != 0) diff --git a/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs b/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs index 57faadb86..6e430543b 100644 --- a/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs +++ b/TLM/TLM/Manager/Impl/VehicleBehaviorManager.cs @@ -898,6 +898,7 @@ bool citizenDebug false, 32f, false, + false, out startPosA, out startPosB, out sqrDistA, diff --git a/TLM/TLM/Resources/whats_new.txt b/TLM/TLM/Resources/whats_new.txt index ca7a08570..6f377916d 100644 --- a/TLM/TLM/Resources/whats_new.txt +++ b/TLM/TLM/Resources/whats_new.txt @@ -1,13 +1,6 @@ -[Version] 11.7.5.0 -[Released] May 24th 2023 -[Link] tmpe-v11750-stable-24052023 +[Version] 11.8.0.0 +[Released] Jun 12th 2023 +[Link] tmpe-v11800-stable-12062023 [Stable] -[Meta] Minor fixes and improvements -[New] Finnish language support! Help us finish translation on Crowdin (link in the mod options) -[Fixed] Silent error on load breaks Lane arrow availability detector #1736 #1747 (krzychu124) -[Fixed] Parking AI bugfixing and reliability improvements. Manually clear parked cars (maintenance tab in the options) in case of issues with parking vehicles in the past #1746 (krzychu124) -[Fixed] Fixed incorrect Citizen Influx value displayed in the City Statistics window #1737 (krzychu124) -[Fixed] Optimized number of pathfinding threads #1744 (krzychu124) -[Updated] Support for game update version 1.17 in the trigger for message about incompatibility with the game -[Updated] Translation update for Romanian, French, Spanish, Arabic, Czech, Finnish, Italian, Polish, Slovak, Turkish, Ukrainian, English and Thai +[Meta] Compatibility patch for 1.17.1-f2 [/Version] \ No newline at end of file diff --git a/TLM/TLM/State/GetSpeedLimitResult.cs b/TLM/TLM/State/GetSpeedLimitResult.cs index f438bd126..134aea863 100644 --- a/TLM/TLM/State/GetSpeedLimitResult.cs +++ b/TLM/TLM/State/GetSpeedLimitResult.cs @@ -21,8 +21,8 @@ public struct GetSpeedLimitResult { } public override string ToString() { - string ov = this.OverrideValue.HasValue ? $"Speed: {this.OverrideValue};" : string.Empty; - string dv = this.DefaultValue.HasValue ? $"Default: {this.DefaultValue}" : string.Empty; + string ov = this.OverrideValue.HasValue ? $"Speed: {this.OverrideValue};" : "NULL"; + string dv = this.DefaultValue.HasValue ? $"Default: {this.DefaultValue}" : "NULL"; return $"({ov} {dv})"; } } diff --git a/TLM/TLM/UI/WhatsNew/WhatsNew.cs b/TLM/TLM/UI/WhatsNew/WhatsNew.cs index f982cf6cc..62e265a66 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,5,0); + public static readonly Version CurrentVersion = new Version(11,8,0,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 be6823dd7..de6c150d0 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 = 205644560U; + public const uint EXPECTED_GAME_VERSION_U = 205775376U; // see comments for EXPECTED_GAME_VERSION_U. - public static Version ExpectedGameVersion => new Version(1, 17, 0, 3); + public static Version ExpectedGameVersion => new Version(1, 17, 1, 2); public static string ExpectedGameVersionString => BuildConfig.VersionToString(EXPECTED_GAME_VERSION_U, false); diff --git a/TLM/TMPE.API/Manager/IExtPathManager.cs b/TLM/TMPE.API/Manager/IExtPathManager.cs index ff4ed20bc..fb64c8973 100644 --- a/TLM/TMPE.API/Manager/IExtPathManager.cs +++ b/TLM/TMPE.API/Manager/IExtPathManager.cs @@ -17,6 +17,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, ItemClass.Service service, @@ -29,6 +30,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -42,6 +44,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -56,6 +59,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPos); bool FindPathPositionWithSpiralLoop(Vector3 position, @@ -68,6 +72,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -84,6 +89,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -100,6 +106,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA, @@ -118,6 +125,7 @@ public interface IExtPathManager { bool requireConnect, float maxDistance, bool excludeLaneWidth, + bool checkPedestrianStreet, out PathUnit.Position pathPosA, out PathUnit.Position pathPosB, out float distanceSqrA,