Skip to content

Commit 43b0071

Browse files
committed
Add missing AI check
(cherry picked from commit 5fe95c0)
1 parent 6287c54 commit 43b0071

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

TLM/TLM/Manager/Impl/ExtVehicleManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,7 @@ private void DetermineVehicleType(ref ExtVehicle extVehicle, ref Vehicle vehicle
936936
case PassengerCarAI _:
937937
return ExtVehicleType.PassengerCar;
938938
case AmbulanceAI _:
939+
case BankVanAI _:
939940
case FireTruckAI _:
940941
case PoliceCarAI _:
941942
case HearseAI _:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace TrafficManager.Patch._VehicleAI._BankVanAI {
2+
using System.Collections.Generic;
3+
using System.Reflection;
4+
using System.Reflection.Emit;
5+
using HarmonyLib;
6+
using JetBrains.Annotations;
7+
using TrafficManager.API.Traffic.Enums;
8+
using TrafficManager.Patch._PathManager;
9+
10+
[HarmonyPatch]
11+
public class StartPathFindPatch {
12+
13+
[UsedImplicitly]
14+
public static MethodBase TargetMethod() => StartPathFindCommons.TargetMethod<BankVanAI>();
15+
16+
[UsedImplicitly]
17+
public static void Prefix(ushort vehicleID, ref Vehicle vehicleData) {
18+
CreatePathPatch.ExtPathType = ExtPathType.None;
19+
CreatePathPatch.ExtVehicleType = ExtVehicleType.Service;
20+
CreatePathPatch.VehicleID = vehicleID;
21+
}
22+
23+
[UsedImplicitly]
24+
[HarmonyPriority(Priority.Low)] // so that if this code is redundant, it would result in warning log.
25+
public static IEnumerable<CodeInstruction> Transpiler(ILGenerator il, IEnumerable<CodeInstruction> instructions) {
26+
return StartPathFindCommons.ReplaceMaxPosTranspiler(instructions);
27+
}
28+
}
29+
}

TLM/TLM/TLM.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
<Compile Include="Patch\_NetLane\CalculateStopPositionAndDirection.cs" />
162162
<Compile Include="Patch\_PedestrianZoneRoadAI\BollardSimulationStepPatch.cs" />
163163
<Compile Include="Patch\_VehicleAI\InvalidPathPatch.cs" />
164+
<Compile Include="Patch\_VehicleAI\_BankVanAI\StartPathFindPatch.cs" />
164165
<Compile Include="Patch\_VehicleAI\_BusAI\CalculateSegmentPositionPatch.cs" />
165166
<Compile Include="State\OptionsTabs\GameplayTab_AIGroups.cs" />
166167
<Compile Include="State\OptionsTabs\GeneralTab_CompatibilityGroup.cs" />

0 commit comments

Comments
 (0)