From cc008c59fe350fbbe777ad2277d54c9ac5f7159f Mon Sep 17 00:00:00 2001 From: kianzzarrin Date: Tue, 25 Jan 2022 17:41:07 +0200 Subject: [PATCH] support for airport DLC --- NodeController/NodeController.csproj | 2 +- NodeController/Patches/NetManager/CreateSegmentPatch.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NodeController/NodeController.csproj b/NodeController/NodeController.csproj index 38ea23e..1a3ebf9 100644 --- a/NodeController/NodeController.csproj +++ b/NodeController/NodeController.csproj @@ -7,7 +7,7 @@ NodeController Copyright © 2020 false - 2.4.2.* + 2.5.* 512 latest full diff --git a/NodeController/Patches/NetManager/CreateSegmentPatch.cs b/NodeController/Patches/NetManager/CreateSegmentPatch.cs index 19ded99..c7ce68a 100644 --- a/NodeController/Patches/NetManager/CreateSegmentPatch.cs +++ b/NodeController/Patches/NetManager/CreateSegmentPatch.cs @@ -1,17 +1,20 @@ namespace NodeController.Patches._NetManager { - using HarmonyLib; using NodeController; using NodeController.LifeCycle; using KianCommons; using static KianCommons.HelpersExtensions; using NodeController.Patches._NetTool; using System; + using ColossalFramework.Math; + using UnityEngine; + using KianCommons.Patches; - // TODO check compat with ParallelRoadTool - [HarmonyPatch(typeof(global::NetManager), nameof(NetManager.CreateSegment))] + [HarmonyPatch2(typeof(NetManager), typeof(CreateSegment))] public static class CreateSegmentPatch { + delegate bool CreateSegment(out ushort segment, ref Randomizer randomizer, NetInfo info, TreeInfo treeInfo, ushort startNode, ushort endNode, Vector3 startDirection, Vector3 endDirection, uint buildIndex, uint modifiedIndex, bool invert); + // pastes segment ends that: // 1- not nullnot null and // 2- its nodeID matches input start/end nodeID.