Decompiled source of Storage Fix v0.1.0
StorageFix.dll
Decompiled 2 years ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Colossal.Logging; using Game; using Game.Buildings; using Game.City; using Game.Common; using Game.Companies; using Game.Creatures; using Game.Economy; using Game.Net; using Game.Objects; using Game.Pathfind; using Game.Prefabs; using Game.Routes; using Game.Simulation; using Game.Tools; using Game.Vehicles; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Burst; using Unity.Burst.Intrinsics; using Unity.Collections; using Unity.Entities; using Unity.Jobs; using Unity.Mathematics; using UnityEngine.Scripting; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("StorageFix")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Temporary fix for negative resources at cargo stations.")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+819e88b558947e8e386b3f25013f1030c1b67d63")] [assembly: AssemblyProduct("StorageFix")] [assembly: AssemblyTitle("StorageFix")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace StorageFix { [HarmonyPatch] internal class Patches { [HarmonyPatch(typeof(SystemOrder), "Initialize")] [HarmonyPostfix] private static void Initialize_Postfix(UpdateSystem updateSystem) { updateSystem.UpdateAt<TransportTrainAISystem>((SystemUpdatePhase)12); updateSystem.UpdateAt<TransportTrainAISystem>((SystemUpdatePhase)26); } [HarmonyPatch(typeof(TransportTrainAISystem), "OnUpdate")] [HarmonyPrefix] private static bool TransportTrainAISystem_OnUpdate() { return false; } } [BepInPlugin("StorageFix", "StorageFix", "0.1.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private static ILog s_Log; public static ConfigEntry<bool> Logging; public static void Log(string text) { if (Logging.Value) { Logger.LogInfo((object)text); s_Log.Info((object)text); } } public static void LogStack(string text) { Logger.LogInfo((object)(text + " STACKTRACE")); s_Log.logStackTrace = true; s_Log.Info((object)(text + "STACKTRACE")); s_Log.logStackTrace = false; } public static string GetCallingMethod(int frame) { MethodBase method = new StackTrace().GetFrame(frame).GetMethod(); return method.DeclaringType?.ToString() + "." + method.Name; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; s_Log = LogManager.GetLogger("StorageFix", true); Logging = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "Logging", false, "Enables logging to a file and BepInEx console"); Logger.LogInfo((object)"Plugin StorageFix is loaded!"); MethodBase[] array = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "StorageFix_Cities2Harmony").GetPatchedMethods().ToArray(); Log("Plugin StorageFix made patches! Patched methods: " + array.Length); MethodBase[] array2 = array; foreach (MethodBase methodBase in array2) { Log("Patched method: " + methodBase.Module.Name + ":" + methodBase.Name); } } } public static class TransportBoardingHelpers { public struct BoardingLookupData { [ReadOnly] public ComponentLookup<TransportLine> m_TransportLineData; [ReadOnly] public ComponentLookup<Connected> m_ConnectedData; [ReadOnly] public ComponentLookup<TransportStop> m_TransportStopData; [ReadOnly] public ComponentLookup<PrefabRef> m_PrefabRefData; [ReadOnly] public ComponentLookup<TransportLineData> m_PrefabTransportLineData; [ReadOnly] public ComponentLookup<CargoTransportVehicleData> m_PrefabCargoTransportVehicleData; [ReadOnly] public ComponentLookup<Train> m_TrainData; [ReadOnly] public ComponentLookup<Aircraft> m_AircraftData; [ReadOnly] public ComponentLookup<Watercraft> m_WatercraftData; [ReadOnly] public ComponentLookup<DeliveryTruck> m_DeliveryTruckData; [ReadOnly] public BufferLookup<LayoutElement> m_LayoutElements; [ReadOnly] public BufferLookup<RouteModifier> m_RouteModifiers; public ComponentLookup<CargoTransport> m_CargoTransportData; public ComponentLookup<PublicTransport> m_PublicTransportData; public ComponentLookup<BoardingVehicle> m_BoardingVehicleData; public ComponentLookup<VehicleTiming> m_VehicleTimingData; public BufferLookup<StorageTransferRequest> m_StorageTransferRequests; public BufferLookup<Resources> m_EconomyResources; public BufferLookup<LoadingResources> m_LoadingResources; public BoardingLookupData(SystemBase system) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) m_TransportLineData = system.GetComponentLookup<TransportLine>(true); m_ConnectedData = system.GetComponentLookup<Connected>(true); m_TransportStopData = system.GetComponentLookup<TransportStop>(true); m_PrefabRefData = system.GetComponentLookup<PrefabRef>(true); m_PrefabTransportLineData = system.GetComponentLookup<TransportLineData>(true); m_PrefabCargoTransportVehicleData = system.GetComponentLookup<CargoTransportVehicleData>(true); m_LayoutElements = system.GetBufferLookup<LayoutElement>(true); m_RouteModifiers = system.GetBufferLookup<RouteModifier>(true); m_CargoTransportData = system.GetComponentLookup<CargoTransport>(false); m_PublicTransportData = system.GetComponentLookup<PublicTransport>(false); m_BoardingVehicleData = system.GetComponentLookup<BoardingVehicle>(false); m_VehicleTimingData = system.GetComponentLookup<VehicleTiming>(false); m_StorageTransferRequests = system.GetBufferLookup<StorageTransferRequest>(false); m_EconomyResources = system.GetBufferLookup<Resources>(false); m_LoadingResources = system.GetBufferLookup<LoadingResources>(false); m_DeliveryTruckData = system.GetComponentLookup<DeliveryTruck>(true); m_AircraftData = system.GetComponentLookup<Aircraft>(true); m_WatercraftData = system.GetComponentLookup<Watercraft>(true); m_TrainData = system.GetComponentLookup<Train>(true); } public void Update(SystemBase system) { m_TransportLineData.Update(system); m_ConnectedData.Update(system); m_TransportStopData.Update(system); m_PrefabRefData.Update(system); m_PrefabTransportLineData.Update(system); m_PrefabCargoTransportVehicleData.Update(system); m_LayoutElements.Update(system); m_RouteModifiers.Update(system); m_CargoTransportData.Update(system); m_PublicTransportData.Update(system); m_BoardingVehicleData.Update(system); m_VehicleTimingData.Update(system); m_StorageTransferRequests.Update(system); m_EconomyResources.Update(system); m_LoadingResources.Update(system); m_DeliveryTruckData.Update(system); m_AircraftData.Update(system); m_WatercraftData.Update(system); m_TrainData.Update(system); } } public struct BoardingData { public struct Concurrent { private ParallelWriter<BoardingItem> m_BoardingQueue; public Concurrent(BoardingData data) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) m_BoardingQueue = data.m_BoardingQueue.AsParallelWriter(); } public void BeginBoarding(Entity vehicle, Entity route, Entity stop, Entity waypoint, Entity currentStation, Entity nextStation, bool refuel) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) BoardingItem boardingItem = default(BoardingItem); boardingItem.m_Begin = true; boardingItem.m_Refuel = refuel; boardingItem.m_Testing = false; boardingItem.m_Vehicle = vehicle; boardingItem.m_Route = route; boardingItem.m_Stop = stop; boardingItem.m_Waypoint = waypoint; boardingItem.m_CurrentStation = currentStation; boardingItem.m_NextStation = nextStation; m_BoardingQueue.Enqueue(boardingItem); } public void EndBoarding(Entity vehicle, Entity route, Entity stop, Entity waypoint, Entity currentStation, Entity nextStation) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) BoardingItem boardingItem = default(BoardingItem); boardingItem.m_Begin = false; boardingItem.m_Refuel = false; boardingItem.m_Testing = false; boardingItem.m_Vehicle = vehicle; boardingItem.m_Route = route; boardingItem.m_Stop = stop; boardingItem.m_Waypoint = waypoint; boardingItem.m_CurrentStation = currentStation; boardingItem.m_NextStation = nextStation; m_BoardingQueue.Enqueue(boardingItem); } public void BeginTesting(Entity vehicle, Entity route, Entity stop, Entity waypoint) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) BoardingItem boardingItem = default(BoardingItem); boardingItem.m_Begin = true; boardingItem.m_Refuel = false; boardingItem.m_Testing = true; boardingItem.m_Vehicle = vehicle; boardingItem.m_Route = route; boardingItem.m_Stop = stop; boardingItem.m_Waypoint = waypoint; boardingItem.m_CurrentStation = Entity.Null; boardingItem.m_NextStation = Entity.Null; m_BoardingQueue.Enqueue(boardingItem); } public void EndTesting(Entity vehicle, Entity route, Entity stop, Entity waypoint) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) BoardingItem boardingItem = default(BoardingItem); boardingItem.m_Begin = false; boardingItem.m_Refuel = false; boardingItem.m_Testing = true; boardingItem.m_Vehicle = vehicle; boardingItem.m_Route = route; boardingItem.m_Stop = stop; boardingItem.m_Waypoint = waypoint; boardingItem.m_CurrentStation = Entity.Null; boardingItem.m_NextStation = Entity.Null; m_BoardingQueue.Enqueue(boardingItem); } } private NativeQueue<BoardingItem> m_BoardingQueue; public BoardingData(Allocator allocator) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) m_BoardingQueue = new NativeQueue<BoardingItem>(AllocatorHandle.op_Implicit(allocator)); } public void Dispose() { m_BoardingQueue.Dispose(); } public void Dispose(JobHandle inputDeps) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) m_BoardingQueue.Dispose(inputDeps); } public JobHandle ScheduleBoarding(SystemBase system, CityStatisticsSystem statsSystem, BoardingLookupData lookupData, uint simulationFrameIndex, JobHandle inputDeps) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) TransportBoardingJob transportBoardingJob = default(TransportBoardingJob); transportBoardingJob.m_SimulationFrameIndex = simulationFrameIndex; transportBoardingJob.m_BoardingLookupData = lookupData; transportBoardingJob.m_BoardingQueue = m_BoardingQueue; JobHandle val = default(JobHandle); transportBoardingJob.m_StatisticsEventQueue = statsSystem.GetStatisticsEventQueue(ref val).AsParallelWriter(); JobHandle val2 = IJobExtensions.Schedule<TransportBoardingJob>(transportBoardingJob, JobHandle.CombineDependencies(inputDeps, val)); statsSystem.AddWriter(val2); return val2; } public Concurrent ToConcurrent() { return new Concurrent(this); } } private struct BoardingItem { public bool m_Begin; public bool m_Refuel; public bool m_Testing; public Entity m_Vehicle; public Entity m_Route; public Entity m_Stop; public Entity m_Waypoint; public Entity m_CurrentStation; public Entity m_NextStation; } [BurstCompile] private struct TransportBoardingJob : IJob { [StructLayout(LayoutKind.Sequential, Size = 1)] private struct LoadingResourceComparer : IComparer<LoadingResources> { public int Compare(LoadingResources x, LoadingResources y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return x.m_Amount - y.m_Amount; } } [ReadOnly] public uint m_SimulationFrameIndex; public BoardingLookupData m_BoardingLookupData; public NativeQueue<BoardingItem> m_BoardingQueue; public ParallelWriter<StatisticsEvent> m_StatisticsEventQueue; public void Execute() { BoardingItem data = default(BoardingItem); while (m_BoardingQueue.TryDequeue(ref data)) { if (data.m_Testing) { if (data.m_Begin) { BeginTesting(data); } else { EndTesting(data); } } else if (data.m_Begin) { BeginBoarding(data); } else { EndBoarding(data); } } } private void BeginTesting(BoardingItem data) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) BoardingVehicle val = m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop]; CargoTransport val2 = default(CargoTransport); PublicTransport val3 = default(PublicTransport); if (!(val.m_Testing != Entity.Null) || !(val.m_Testing != data.m_Vehicle) || ((!m_BoardingLookupData.m_CargoTransportData.TryGetComponent(val.m_Testing, ref val2) || (val2.m_State & 0x100) == 0) && (!m_BoardingLookupData.m_PublicTransportData.TryGetComponent(val.m_Testing, ref val3) || (val3.m_State & 0x800) == 0))) { val.m_Testing = data.m_Vehicle; m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop] = val; if (m_BoardingLookupData.m_CargoTransportData.HasComponent(data.m_Vehicle)) { CargoTransport val4 = m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle]; ref CargoTransportFlags state = ref val4.m_State; state = (CargoTransportFlags)((uint)state & 0xFFFFFDFFu); ref CargoTransportFlags state2 = ref val4.m_State; state2 = (CargoTransportFlags)((uint)state2 | 0x100u); m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle] = val4; } if (m_BoardingLookupData.m_PublicTransportData.HasComponent(data.m_Vehicle)) { PublicTransport val5 = m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle]; ref PublicTransportFlags state3 = ref val5.m_State; state3 = (PublicTransportFlags)((uint)state3 & 0xFFFFEFFFu); ref PublicTransportFlags state4 = ref val5.m_State; state4 = (PublicTransportFlags)((uint)state4 | 0x800u); m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle] = val5; } } } private void EndTesting(BoardingItem data) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) BoardingVehicle val = m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop]; if (val.m_Testing == data.m_Vehicle) { val.m_Testing = Entity.Null; m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop] = val; } if (m_BoardingLookupData.m_CargoTransportData.HasComponent(data.m_Vehicle)) { CargoTransport val2 = m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle]; ref CargoTransportFlags state = ref val2.m_State; state = (CargoTransportFlags)((uint)state & 0xFFFFFEFFu); m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle] = val2; } if (m_BoardingLookupData.m_PublicTransportData.HasComponent(data.m_Vehicle)) { PublicTransport val3 = m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle]; ref PublicTransportFlags state2 = ref val3.m_State; state2 = (PublicTransportFlags)((uint)state2 & 0xFFFFF7FFu); m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle] = val3; } } private void BeginBoarding(BoardingItem data) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) BoardingVehicle val = m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop]; CargoTransport val2 = default(CargoTransport); PublicTransport val3 = default(PublicTransport); if (val.m_Vehicle != Entity.Null && val.m_Vehicle != data.m_Vehicle && ((m_BoardingLookupData.m_CargoTransportData.TryGetComponent(val.m_Vehicle, ref val2) && (val2.m_State & 4) != 0) || (m_BoardingLookupData.m_PublicTransportData.TryGetComponent(val.m_Vehicle, ref val3) && (val3.m_State & 4) != 0))) { return; } PrefabRef val4 = m_BoardingLookupData.m_PrefabRefData[data.m_Route]; TransportLine val5 = m_BoardingLookupData.m_TransportLineData[data.m_Route]; VehicleTiming val6 = m_BoardingLookupData.m_VehicleTimingData[data.m_Waypoint]; Connected val7 = m_BoardingLookupData.m_ConnectedData[data.m_Waypoint]; DynamicBuffer<RouteModifier> val8 = m_BoardingLookupData.m_RouteModifiers[data.m_Route]; CargoTransport val9 = default(CargoTransport); PublicTransport val10 = default(PublicTransport); uint num = 0u; if (m_BoardingLookupData.m_CargoTransportData.HasComponent(data.m_Vehicle)) { val9 = m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle]; num = val9.m_DepartureFrame; } if (m_BoardingLookupData.m_PublicTransportData.HasComponent(data.m_Vehicle)) { val10 = m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle]; num = val10.m_DepartureFrame; } TransportLineData val11 = m_BoardingLookupData.m_PrefabTransportLineData[val4.m_Prefab]; float num2 = ((!m_BoardingLookupData.m_TransportStopData.HasComponent(val7.m_Connected)) ? val11.m_StopDuration : RouteUtils.GetStopDuration(val11, m_BoardingLookupData.m_TransportStopData[val7.m_Connected])); val.m_Vehicle = data.m_Vehicle; val6.m_AverageTravelTime = RouteUtils.UpdateAverageTravelTime(val6.m_AverageTravelTime, num, m_SimulationFrameIndex); num = (((val9.m_State & 2) == 0 && (val10.m_State & 2) == 0) ? (m_SimulationFrameIndex + 60) : (val6.m_LastDepartureFrame = RouteUtils.CalculateDepartureFrame(val5, val11, val8, num2, val6.m_LastDepartureFrame, m_SimulationFrameIndex))); m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop] = val; m_BoardingLookupData.m_VehicleTimingData[data.m_Waypoint] = val6; if (m_BoardingLookupData.m_CargoTransportData.HasComponent(data.m_Vehicle)) { ref CargoTransportFlags state = ref val9.m_State; state = (CargoTransportFlags)((uint)state | 4u); if (data.m_Refuel) { ref CargoTransportFlags state2 = ref val9.m_State; state2 = (CargoTransportFlags)((uint)state2 | 0x20u); } val9.m_DepartureFrame = num; m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle] = val9; } if (m_BoardingLookupData.m_PublicTransportData.HasComponent(data.m_Vehicle)) { ref PublicTransportFlags state3 = ref val10.m_State; state3 = (PublicTransportFlags)((uint)state3 | 4u); if (data.m_Refuel) { ref PublicTransportFlags state4 = ref val10.m_State; state4 = (PublicTransportFlags)((uint)state4 | 0x100u); } val10.m_DepartureFrame = num; m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle] = val10; } DynamicBuffer<LoadingResources> loadingResources = default(DynamicBuffer<LoadingResources>); if (m_BoardingLookupData.m_LoadingResources.HasBuffer(data.m_Vehicle)) { loadingResources = m_BoardingLookupData.m_LoadingResources[data.m_Vehicle]; loadingResources.Clear(); } UnloadResources(data.m_Vehicle, data.m_CurrentStation); LoadResources(data.m_Vehicle, data.m_CurrentStation, data.m_NextStation, loadingResources); } private void EndBoarding(BoardingItem data) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) BoardingVehicle val = m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop]; if (val.m_Vehicle == data.m_Vehicle) { val.m_Vehicle = Entity.Null; m_BoardingLookupData.m_BoardingVehicleData[data.m_Stop] = val; LoadResources(data.m_Vehicle, data.m_CurrentStation, data.m_NextStation, default(DynamicBuffer<LoadingResources>)); } if (m_BoardingLookupData.m_CargoTransportData.HasComponent(data.m_Vehicle)) { CargoTransport val2 = m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle]; ref CargoTransportFlags state = ref val2.m_State; state = (CargoTransportFlags)((uint)state & 0xFFFFFFDBu); m_BoardingLookupData.m_CargoTransportData[data.m_Vehicle] = val2; } if (m_BoardingLookupData.m_PublicTransportData.HasComponent(data.m_Vehicle)) { PublicTransport val3 = m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle]; ref PublicTransportFlags state2 = ref val3.m_State; state2 = (PublicTransportFlags)((uint)state2 & 0xFFFFFEFBu); m_BoardingLookupData.m_PublicTransportData[data.m_Vehicle] = val3; } } private void UnloadResources(Entity vehicle, Entity target) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) if (!m_BoardingLookupData.m_EconomyResources.HasBuffer(target)) { return; } DynamicBuffer<Resources> val = m_BoardingLookupData.m_EconomyResources[target]; Plugin.Log($"Checking resources at {target.Index} while Unloading"); ResourceIterator iterator = ResourceIterator.GetIterator(); while (((ResourceIterator)(ref iterator)).Next()) { if (EconomyUtils.GetResources(iterator.resource, val) < 0) { Plugin.Log($"...Fixing negative {iterator.resource} at {target.Index}"); EconomyUtils.SetResources(iterator.resource, val, 0); } } if (m_BoardingLookupData.m_LayoutElements.HasBuffer(vehicle)) { DynamicBuffer<LayoutElement> val2 = m_BoardingLookupData.m_LayoutElements[vehicle]; for (int i = 0; i < val2.Length; i++) { Entity vehicle2 = val2[i].m_Vehicle; if (m_BoardingLookupData.m_EconomyResources.HasBuffer(vehicle2)) { DynamicBuffer<Resources> sourceResources = m_BoardingLookupData.m_EconomyResources[vehicle2]; UnloadResources(sourceResources, val); } } } else if (m_BoardingLookupData.m_EconomyResources.HasBuffer(vehicle)) { DynamicBuffer<Resources> sourceResources2 = m_BoardingLookupData.m_EconomyResources[vehicle]; UnloadResources(sourceResources2, val); } } private void UnloadResources(DynamicBuffer<Resources> sourceResources, DynamicBuffer<Resources> targetResources) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < sourceResources.Length; i++) { Resources val = sourceResources[i]; EconomyUtils.AddResources(val.m_Resource, val.m_Amount, targetResources); } sourceResources.Clear(); } private void LoadResources(Entity vehicle, Entity source, Entity target, DynamicBuffer<LoadingResources> loadingResources) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) if (m_BoardingLookupData.m_EconomyResources.HasBuffer(source) && m_BoardingLookupData.m_StorageTransferRequests.HasBuffer(source)) { DynamicBuffer<Resources> val = m_BoardingLookupData.m_EconomyResources[source]; DynamicBuffer<StorageTransferRequest> val2 = m_BoardingLookupData.m_StorageTransferRequests[source]; int num = 0; while (num < val2.Length) { StorageTransferRequest val3 = val2[num]; if ((val3.m_Flags & 8) != 0 || (val3.m_Flags & 2) == 0 || val3.m_Target != target) { num++; continue; } int resources = EconomyUtils.GetResources(val3.m_Resource, val); if (resources < 0) { Plugin.Log($"Fixing negative {val3.m_Resource} at {source.Index}..."); EconomyUtils.SetResources(val3.m_Resource, val, 0); Plugin.Log($"...and removing impossible transfer request for {val3.m_Amount} of {val3.m_Resource} at {source.Index} (we have 0)"); val2.RemoveAt(num); continue; } if (resources == 0) { Plugin.Log($"Removing impossible transfer request for {val3.m_Amount} of {val3.m_Resource} at {source.Index} (we have 0)"); val2.RemoveAt(num); continue; } if (val3.m_Amount > resources) { Plugin.Log($"Tweaking impossible transfer request for {val3.m_Amount} of {val3.m_Resource} at {source.Index} - we have {resources} - setting to half"); val3.m_Amount = resources >> 1; } if (val3.m_Amount > 0) { int amount = val3.m_Amount; LoadResources(val3.m_Resource, ref val3.m_Amount, vehicle); if (val3.m_Amount < amount) { EconomyUtils.AddResources(val3.m_Resource, val3.m_Amount - amount, val); } } if (val3.m_Amount == 0) { val2.RemoveAt(num); continue; } val2[num++] = val3; if (!loadingResources.IsCreated) { continue; } for (int i = 0; i < loadingResources.Length; i++) { LoadingResources val4 = loadingResources[i]; if (val4.m_Resource == val3.m_Resource) { val4.m_Amount += val3.m_Amount; loadingResources[i] = val4; val3.m_Amount = 0; break; } } if (val3.m_Amount != 0) { loadingResources.Add(new LoadingResources { m_Resource = val3.m_Resource, m_Amount = val3.m_Amount }); } } } if (loadingResources.IsCreated && loadingResources.Length >= 2) { NativeSortExtension.Sort<LoadingResources, LoadingResourceComparer>(loadingResources.AsNativeArray(), default(LoadingResourceComparer)); } } private void LoadResources(Resource resource, ref int amount, Entity vehicle) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (m_BoardingLookupData.m_LayoutElements.HasBuffer(vehicle)) { DynamicBuffer<LayoutElement> val = m_BoardingLookupData.m_LayoutElements[vehicle]; for (int i = 0; i < val.Length; i++) { Entity vehicle2 = val[i].m_Vehicle; if (m_BoardingLookupData.m_EconomyResources.HasBuffer(vehicle2)) { PrefabRef val2 = m_BoardingLookupData.m_PrefabRefData[vehicle2]; CargoTransportVehicleData vehicleData = m_BoardingLookupData.m_PrefabCargoTransportVehicleData[val2.m_Prefab]; DynamicBuffer<Resources> targetResources = m_BoardingLookupData.m_EconomyResources[vehicle2]; TransportType vehicleType = GetVehicleType(vehicle2); LoadResources(resource, ref amount, vehicleData, targetResources, vehicleType); if (amount == 0) { break; } } } } else if (m_BoardingLookupData.m_EconomyResources.HasBuffer(vehicle)) { PrefabRef val3 = m_BoardingLookupData.m_PrefabRefData[vehicle]; CargoTransportVehicleData vehicleData2 = m_BoardingLookupData.m_PrefabCargoTransportVehicleData[val3.m_Prefab]; DynamicBuffer<Resources> targetResources2 = m_BoardingLookupData.m_EconomyResources[vehicle]; TransportType vehicleType2 = GetVehicleType(vehicle); LoadResources(resource, ref amount, vehicleData2, targetResources2, vehicleType2); } } private void LoadResources(Resource resource, ref int amount, CargoTransportVehicleData vehicleData, DynamicBuffer<Resources> targetResources, TransportType transportType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Invalid comparison between Unknown and I4 //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) int num = vehicleData.m_CargoCapacity; int num2 = -1; for (int i = 0; i < targetResources.Length; i++) { Resources val = targetResources[i]; num -= val.m_Amount; num2 = math.select(num2, i, val.m_Resource == resource); } int num3 = math.min(num, amount); if (num3 == 0) { return; } if (num2 >= 0) { Resources val2 = targetResources[num2]; val2.m_Amount += num3; targetResources[num2] = val2; } else { if (targetResources.Length >= vehicleData.m_MaxResourceCount || (vehicleData.m_Resources & resource) == 0) { return; } Resources val3 = default(Resources); val3.m_Resource = resource; val3.m_Amount = num3; targetResources.Add(val3); } amount -= num3; if ((int)transportType != 1) { if ((int)transportType != 4) { if ((int)transportType == 7) { m_StatisticsEventQueue.Enqueue(new StatisticsEvent { m_Statistic = (StatisticType)51, m_Change = num3 }); } } else { m_StatisticsEventQueue.Enqueue(new StatisticsEvent { m_Statistic = (StatisticType)50, m_Change = num3 }); } } else { m_StatisticsEventQueue.Enqueue(new StatisticsEvent { m_Statistic = (StatisticType)49, m_Change = num3 }); } } private TransportType GetVehicleType(Entity vehicle) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!m_BoardingLookupData.m_AircraftData.HasComponent(vehicle)) { if (!m_BoardingLookupData.m_TrainData.HasComponent(vehicle)) { if (!m_BoardingLookupData.m_WatercraftData.HasComponent(vehicle)) { if (!m_BoardingLookupData.m_DeliveryTruckData.HasComponent(vehicle)) { return (TransportType)(-1); } return (TransportType)0; } return (TransportType)4; } return (TransportType)1; } return (TransportType)7; } } } [CompilerGenerated] public class TransportTrainAISystem : GameSystemBase { [BurstCompile] private struct TransportTrainTickJob : IJobChunk { [ReadOnly] public EntityTypeHandle m_EntityType; [ReadOnly] public ComponentTypeHandle<Owner> m_OwnerType; [ReadOnly] public ComponentTypeHandle<Unspawned> m_UnspawnedType; [ReadOnly] public ComponentTypeHandle<PrefabRef> m_PrefabRefType; [ReadOnly] public ComponentTypeHandle<CurrentRoute> m_CurrentRouteType; public ComponentTypeHandle<CargoTransport> m_CargoTransportType; public ComponentTypeHandle<PublicTransport> m_PublicTransportType; public ComponentTypeHandle<Target> m_TargetType; public ComponentTypeHandle<PathOwner> m_PathOwnerType; public ComponentTypeHandle<Odometer> m_OdometerType; public BufferTypeHandle<LayoutElement> m_LayoutElementType; public BufferTypeHandle<TrainNavigationLane> m_NavigationLaneType; public BufferTypeHandle<ServiceDispatch> m_ServiceDispatchType; [ReadOnly] public ComponentLookup<Transform> m_TransformData; [ReadOnly] public ComponentLookup<Owner> m_OwnerData; [ReadOnly] public ComponentLookup<PathInformation> m_PathInformationData; [ReadOnly] public ComponentLookup<TransportVehicleRequest> m_TransportVehicleRequestData; [ReadOnly] public ComponentLookup<Curve> m_CurveData; [ReadOnly] public ComponentLookup<Lane> m_LaneData; [ReadOnly] public ComponentLookup<EdgeLane> m_EdgeLaneData; [ReadOnly] public ComponentLookup<Edge> m_EdgeData; [ReadOnly] public ComponentLookup<TrainData> m_PrefabTrainData; [ReadOnly] public ComponentLookup<PrefabRef> m_PrefabRefData; [ReadOnly] public ComponentLookup<PublicTransportVehicleData> m_PublicTransportVehicleData; [ReadOnly] public ComponentLookup<CargoTransportVehicleData> m_CargoTransportVehicleData; [ReadOnly] public ComponentLookup<Waypoint> m_WaypointData; [ReadOnly] public ComponentLookup<Connected> m_ConnectedData; [ReadOnly] public ComponentLookup<BoardingVehicle> m_BoardingVehicleData; [ReadOnly] public ComponentLookup<StorageCompany> m_StorageCompanyData; [ReadOnly] public ComponentLookup<TransportStation> m_TransportStationData; [ReadOnly] public ComponentLookup<CurrentVehicle> m_CurrentVehicleData; [ReadOnly] public BufferLookup<Passenger> m_Passengers; [ReadOnly] public BufferLookup<Resources> m_EconomyResources; [ReadOnly] public BufferLookup<RouteWaypoint> m_RouteWaypoints; [ReadOnly] public BufferLookup<ConnectedEdge> m_ConnectedEdges; [ReadOnly] public BufferLookup<SubLane> m_SubLanes; [NativeDisableParallelForRestriction] public ComponentLookup<Train> m_TrainData; [NativeDisableParallelForRestriction] public ComponentLookup<TrainCurrentLane> m_CurrentLaneData; [NativeDisableParallelForRestriction] public ComponentLookup<TrainNavigation> m_NavigationData; [NativeDisableParallelForRestriction] public BufferLookup<PathElement> m_PathElements; [NativeDisableParallelForRestriction] public BufferLookup<LoadingResources> m_LoadingResources; [ReadOnly] public uint m_SimulationFrameIndex; [ReadOnly] public RandomSeed m_RandomSeed; [ReadOnly] public EntityArchetype m_TransportVehicleRequestArchetype; [ReadOnly] public EntityArchetype m_HandleRequestArchetype; [ReadOnly] public TransportTrainCarriageSelectData m_TransportTrainCarriageSelectData; public ParallelWriter m_CommandBuffer; public ParallelWriter<SetupQueueItem> m_PathfindQueue; public TransportBoardingHelpers.BoardingData.Concurrent m_BoardingData; public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) NativeArray<Entity> nativeArray = ((ArchetypeChunk)(ref chunk)).GetNativeArray(m_EntityType); NativeArray<Owner> nativeArray2 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<Owner>(ref m_OwnerType); NativeArray<PrefabRef> nativeArray3 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<PrefabRef>(ref m_PrefabRefType); NativeArray<CurrentRoute> nativeArray4 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<CurrentRoute>(ref m_CurrentRouteType); NativeArray<CargoTransport> nativeArray5 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<CargoTransport>(ref m_CargoTransportType); NativeArray<PublicTransport> nativeArray6 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<PublicTransport>(ref m_PublicTransportType); NativeArray<Target> nativeArray7 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<Target>(ref m_TargetType); NativeArray<PathOwner> nativeArray8 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<PathOwner>(ref m_PathOwnerType); NativeArray<Odometer> nativeArray9 = ((ArchetypeChunk)(ref chunk)).GetNativeArray<Odometer>(ref m_OdometerType); BufferAccessor<LayoutElement> bufferAccessor = ((ArchetypeChunk)(ref chunk)).GetBufferAccessor<LayoutElement>(ref m_LayoutElementType); BufferAccessor<TrainNavigationLane> bufferAccessor2 = ((ArchetypeChunk)(ref chunk)).GetBufferAccessor<TrainNavigationLane>(ref m_NavigationLaneType); BufferAccessor<ServiceDispatch> bufferAccessor3 = ((ArchetypeChunk)(ref chunk)).GetBufferAccessor<ServiceDispatch>(ref m_ServiceDispatchType); Random random = ((RandomSeed)(ref m_RandomSeed)).GetRandom(unfilteredChunkIndex); bool isUnspawned = ((ArchetypeChunk)(ref chunk)).Has<Unspawned>(ref m_UnspawnedType); for (int i = 0; i < nativeArray.Length; i++) { Entity vehicleEntity = nativeArray[i]; Owner owner = nativeArray2[i]; PrefabRef prefabRef = nativeArray3[i]; PathOwner pathOwner = nativeArray8[i]; Target target = nativeArray7[i]; Odometer odometer = nativeArray9[i]; DynamicBuffer<LayoutElement> layout = bufferAccessor[i]; DynamicBuffer<TrainNavigationLane> navigationLanes = bufferAccessor2[i]; DynamicBuffer<ServiceDispatch> serviceDispatches = bufferAccessor3[i]; CurrentRoute currentRoute = default(CurrentRoute); if (nativeArray4.Length != 0) { currentRoute = nativeArray4[i]; } CargoTransport cargoTransport = default(CargoTransport); if (nativeArray5.Length != 0) { cargoTransport = nativeArray5[i]; } PublicTransport publicTransport = default(PublicTransport); if (nativeArray6.Length != 0) { publicTransport = nativeArray6[i]; } Tick(unfilteredChunkIndex, ref random, vehicleEntity, owner, prefabRef, currentRoute, layout, navigationLanes, serviceDispatches, isUnspawned, ref cargoTransport, ref publicTransport, ref pathOwner, ref target, ref odometer); nativeArray8[i] = pathOwner; nativeArray7[i] = target; nativeArray9[i] = odometer; if (nativeArray5.Length != 0) { nativeArray5[i] = cargoTransport; } if (nativeArray6.Length != 0) { nativeArray6[i] = publicTransport; } } } private void Tick(int jobIndex, ref Random random, Entity vehicleEntity, Owner owner, PrefabRef prefabRef, CurrentRoute currentRoute, DynamicBuffer<LayoutElement> layout, DynamicBuffer<TrainNavigationLane> navigationLanes, DynamicBuffer<ServiceDispatch> serviceDispatches, bool isUnspawned, ref CargoTransport cargoTransport, ref PublicTransport publicTransport, ref PathOwner pathOwner, ref Target target, ref Odometer odometer) { //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Invalid comparison between Unknown and I4 //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_0789: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) //IL_07b2: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing r