You are on page 1of 7

PATCHING TrainAI Boolean TrySpawn(UInt16, Vehicle ByRef)

L_0000: Local var #0 PathManager


L_0000: Local var #1 PathUnit+Position
L_0000: Local var #2 System.UInt32
L_0000: Local var #3 System.Boolean
L_0000: ldc.i4 0
L_0005: stloc 3 (System.Boolean)
L_0006: ldloca 3 (System.Boolean)
L_0008: ldarg 1
L_000e: ldarg 2
L_0014: call Boolean TrainAI_Prefix_TrySpawn(Boolean ByRef, UInt16, Vehicle ByRef)
L_0019: brfalse Label #1
L_001e: ldarg.2
L_001f: ldfld Vehicle+Flags m_flags
L_0024: ldc.i4.4
L_0025: and
L_0026: brfalse Label #2
L_002b: ldc.i4.1
L_002c: br Label #0
L_0031: Label #2
L_0031: ldarg.2
L_0032: ldfld System.UInt32 m_path
L_0037: brfalse Label #3
L_003c: call PathManager get_instance()
L_0041: stloc.0
L_0042: ldloc.0
L_0043: ldfld Array32`1[PathUnit] m_pathUnits
L_0048: ldfld PathUnit[] m_buffer
L_004d: ldarg.2
L_004e: ldfld System.UInt32 m_path
L_0053: conv.u
L_0054: ldelema PathUnit
L_0059: ldc.i4.0
L_005a: ldloca.s 1 (PathUnit+Position)
L_005c: call Boolean GetPosition(Int32, Position ByRef)
L_0061: brfalse Label #4
L_0066: ldloc.1
L_0067: call UInt32 GetLaneID(Position)
L_006c: stloc.2
L_006d: ldloc.2
L_006e: brfalse Label #5
L_0073: call NetManager get_instance()
L_0078: ldfld Array32`1[NetLane] m_lanes
L_007d: ldfld NetLane[] m_buffer
L_0082: ldloc.2
L_0083: conv.u
L_0084: ldelema NetLane
L_0089: ldc.r4 1000
L_008e: ldarg.1
L_008f: call Boolean CheckSpace(Single, UInt16)
L_0094: brtrue Label #6
L_0099: ldarg.2
L_009a: dup
L_009b: ldfld Vehicle+Flags m_flags
L_00a0: ldc.i4 65536
L_00a5: or
L_00a6: stfld Vehicle+Flags m_flags
L_00ab: ldc.i4.0
L_00ac: br Label #0
L_00b1: Label #3
L_00b1: Label #4
L_00b1: Label #5
L_00b1: Label #6
L_00b1: ldarg.2
L_00b2: ldarg.1
L_00b3: call Void Spawn(UInt16)
L_00b8: ldarg.2
L_00b9: dup
L_00ba: ldfld Vehicle+Flags m_flags
L_00bf: ldc.i4 -65537
L_00c4: and
L_00c5: stfld Vehicle+Flags m_flags
L_00ca: ldarg.1
L_00cb: ldarg.2
L_00cc: call Void InitializePath(UInt16, Vehicle ByRef)
L_00d1: ldc.i4.1
L_00d2: br Label #0
L_00d7: Label #0
L_00d7: stloc 3 (System.Boolean)
L_00d8: Label #1
L_00d8: ldloc 3 (System.Boolean)
L_00d9: ret
DONE

PATCHING TramBaseAI Boolean TrySpawn(UInt16, Vehicle ByRef)


L_0000: Local var #0 PathManager
L_0000: Local var #1 PathUnit+Position
L_0000: Local var #2 System.UInt32
L_0000: Local var #3 System.Boolean
L_0000: ldc.i4 0
L_0005: stloc 3 (System.Boolean)
L_0006: ldloca 3 (System.Boolean)
L_0008: ldarg 1
L_000e: ldarg 2
L_0014: call Boolean TramBaseAI_Prefix_TrySpawn(Boolean ByRef, UInt16, Vehicle
ByRef)
L_0019: brfalse Label #1
L_001e: ldarg.2
L_001f: ldfld Vehicle+Flags m_flags
L_0024: ldc.i4.4
L_0025: and
L_0026: brfalse Label #2
L_002b: ldc.i4.1
L_002c: br Label #0
L_0031: Label #2
L_0031: ldarg.2
L_0032: ldfld System.UInt32 m_path
L_0037: brfalse Label #3
L_003c: call PathManager get_instance()
L_0041: stloc.0
L_0042: ldloc.0
L_0043: ldfld Array32`1[PathUnit] m_pathUnits
L_0048: ldfld PathUnit[] m_buffer
L_004d: ldarg.2
L_004e: ldfld System.UInt32 m_path
L_0053: conv.u
L_0054: ldelema PathUnit
L_0059: ldc.i4.0
L_005a: ldloca.s 1 (PathUnit+Position)
L_005c: call Boolean GetPosition(Int32, Position ByRef)
L_0061: brfalse Label #4
L_0066: ldloc.1
L_0067: call UInt32 GetLaneID(Position)
L_006c: stloc.2
L_006d: ldloc.2
L_006e: brfalse Label #5
L_0073: call NetManager get_instance()
L_0078: ldfld Array32`1[NetLane] m_lanes
L_007d: ldfld NetLane[] m_buffer
L_0082: ldloc.2
L_0083: conv.u
L_0084: ldelema NetLane
L_0089: ldc.r4 1000
L_008e: ldarg.1
L_008f: call Boolean CheckSpace(Single, UInt16)
L_0094: brtrue Label #6
L_0099: ldarg.2
L_009a: dup
L_009b: ldfld Vehicle+Flags m_flags
L_00a0: ldc.i4 65536
L_00a5: or
L_00a6: stfld Vehicle+Flags m_flags
L_00ab: ldc.i4.0
L_00ac: br Label #0
L_00b1: Label #3
L_00b1: Label #4
L_00b1: Label #5
L_00b1: Label #6
L_00b1: ldarg.2
L_00b2: ldarg.1
L_00b3: call Void Spawn(UInt16)
L_00b8: ldarg.2
L_00b9: dup
L_00ba: ldfld Vehicle+Flags m_flags
L_00bf: ldc.i4 -65537
L_00c4: and
L_00c5: stfld Vehicle+Flags m_flags
L_00ca: ldarg.1
L_00cb: ldarg.2
L_00cc: call Void InitializePath(UInt16, Vehicle ByRef)
L_00d1: ldc.i4.1
L_00d2: br Label #0
L_00d7: Label #0
L_00d7: stloc 3 (System.Boolean)
L_00d8: Label #1
L_00d8: ldloc 3 (System.Boolean)
L_00d9: ret
DONE

PATCHING CargoTrainAI Void SimulationStep(UInt16, Vehicle ByRef, Vector3)


L_0000: Local var #0 System.Boolean
L_0000: Local var #1 System.Byte
L_0000: Local var #2 Vehicle+Flags
L_0000: ldc.i4 0
L_0005: stloc 2 (Vehicle+Flags)
L_0006: ldloca 2 (Vehicle+Flags)
L_0008: ldarg 1
L_000e: ldarg 2
L_0014: call Void SimulationStep_Prefix(Flags ByRef, UInt16, Vehicle ByRef)
L_0019: ldarg.2
L_001a: ldfld Vehicle+Flags m_flags
L_001f: ldc.i4 131072
L_0024: and
L_0025: brfalse Label #2
L_002a: call SimulationManager get_instance()
L_002f: ldflda ColossalFramework.Math.Randomizer m_randomizer
L_0034: ldc.i4.2
L_0035: call Int32 Int32(UInt32)
L_003a: ldc.i4.0
L_003b: ceq
L_003d: stloc.0
L_003e: ldloc.0
L_003f: brtrue Label #3
L_0044: ldarg.2
L_0045: ldfld System.UInt16 m_sourceBuilding
L_004a: brfalse Label #4
L_004f: call BuildingManager get_instance()
L_0054: ldfld Array16`1[Building] m_buildings
L_0059: ldfld Building[] m_buffer
L_005e: ldarg.2
L_005f: ldfld System.UInt16 m_sourceBuilding
L_0064: ldelema Building
L_0069: ldfld Building+Flags m_flags
L_006e: ldc.i4 131072
L_0073: and
L_0074: brtrue Label #5
L_0079: ldc.i4.1
L_007a: stloc.0
L_007b: Label #3
L_007b: Label #4
L_007b: Label #5
L_007b: ldloc.0
L_007c: brtrue Label #6
L_0081: ldarg.2
L_0082: ldfld System.UInt16 m_targetBuilding
L_0087: brfalse Label #7
L_008c: call BuildingManager get_instance()
L_0091: ldfld Array16`1[Building] m_buildings
L_0096: ldfld Building[] m_buffer
L_009b: ldarg.2
L_009c: ldfld System.UInt16 m_targetBuilding
L_00a1: ldelema Building
L_00a6: ldfld Building+Flags m_flags
L_00ab: ldc.i4 131072
L_00b0: and
L_00b1: brtrue Label #8
L_00b6: ldc.i4.1
L_00b7: stloc.0
L_00b8: Label #6
L_00b8: Label #7
L_00b8: Label #8
L_00b8: ldloc.0
L_00b9: brtrue Label #9
L_00be: ldarg.2
L_00bf: ldfld System.UInt16 m_transferSize
L_00c4: ldarg.0
L_00c5: ldfld System.Int32 m_cargoCapacity
L_00ca: blt Label #10
L_00cf: ldarg.2
L_00d0: ldc.i4 255
L_00d5: stfld System.Byte m_waitCounter
L_00da: br Label #11
L_00df: Label #10
L_00df: ldarg.2
L_00e0: ldarg.2
L_00e1: ldfld System.Byte m_waitCounter
L_00e6: ldc.i4.1
L_00e7: add
L_00e8: ldc.i4 255
L_00ed: call Int32 Min(Int32, Int32)
L_00f2: conv.u1
L_00f3: stfld System.Byte m_waitCounter
L_00f8: Label #11
L_00f8: ldarg.2
L_00f9: ldfld System.Byte m_waitCounter
L_00fe: ldc.i4 255
L_0103: bne.un Label #12
L_0108: ldarg.2
L_0109: ldfld Vehicle+Flags m_flags
L_010e: ldc.i4.4
L_010f: and
L_0110: brtrue Label #13
L_0115: ldarg.0
L_0116: ldarg.2
L_0117: call Vector3 GetLastFramePosition()
L_011c: callvirt Boolean CanSpawnAt(Vector3)
L_0121: brfalse Label #14
L_0126: Label #13
L_0126: ldarg.2
L_0127: dup
L_0128: ldfld Vehicle+Flags m_flags
L_012d: ldc.i4 -131073
L_0132: and
L_0133: stfld Vehicle+Flags m_flags
L_0138: ldarg.2
L_0139: ldc.i4.0
L_013a: stfld System.Byte m_waitCounter
L_013f: ldarg.0
L_0140: ldarg.1
L_0141: ldarg.2
L_0142: callvirt Boolean StartPathFind(UInt16, Vehicle ByRef)
L_0147: pop
L_0148: Label #9
L_0148: Label #12
L_0148: Label #14
L_0148: br Label #15
L_014d: Label #2
L_014d: ldarg.2
L_014e: ldfld Vehicle+Flags m_flags
L_0153: ldc.i4 512
L_0158: and
L_0159: brfalse Label #16
L_015e: ldarg.2
L_015f: ldfld Vehicle+Flags m_flags
L_0164: ldc.i4.4
L_0165: and
L_0166: brfalse Label #17
L_016b: ldarg.2
L_016c: dup
L_016d: ldfld System.Byte m_waitCounter
L_0172: ldc.i4.1
L_0173: add
L_0174: conv.u1
L_0175: dup
L_0176: stloc.1
L_0177: stfld System.Byte m_waitCounter
L_017c: ldloc.1
L_017d: ldc.i4.s 16
L_017f: bne.un Label #18
L_0184: ldarg.2
L_0185: dup
L_0186: ldfld Vehicle+Flags m_flags
L_018b: ldc.i4 -33554945
L_0190: and
L_0191: stfld Vehicle+Flags m_flags
L_0196: ldarg.2
L_0197: ldc.i4.0
L_0198: stfld System.Byte m_waitCounter
L_019d: Label #17
L_019d: Label #18
L_019d: br Label #19
L_01a2: Label #16
L_01a2: ldarg.2
L_01a3: ldfld Vehicle+Flags m_flags
L_01a8: ldc.i4 262144
L_01ad: and
L_01ae: brtrue Label #20
L_01b3: ldarg.2
L_01b4: ldfld System.UInt16 m_targetBuilding
L_01b9: brfalse Label #21
L_01be: call BuildingManager get_instance()
L_01c3: ldfld Array16`1[Building] m_buildings
L_01c8: ldfld Building[] m_buffer
L_01cd: ldarg.2
L_01ce: ldfld System.UInt16 m_targetBuilding
L_01d3: ldelema Building
L_01d8: ldfld Building+Flags m_flags
L_01dd: ldc.i4 131072
L_01e2: and
L_01e3: brtrue Label #22
L_01e8: ldarg.0
L_01e9: ldarg.1
L_01ea: ldarg.2
L_01eb: ldc.i4.0
L_01ec: callvirt Void SetTarget(UInt16, Vehicle ByRef, UInt16)
L_01f1: Label #15
L_01f1: Label #19
L_01f1: Label #20
L_01f1: Label #21
L_01f1: Label #22
L_01f1: ldarg.0
L_01f2: ldarg.1
L_01f3: ldarg.2
L_01f4: ldarg.3
L_01f5: call Void SimulationStep(UInt16, Vehicle ByRef, Vector3)
L_01fa: br Label #0
L_01ff: Label #0
L_01ff: ldloc 2 (Vehicle+Flags)
L_0200: ldarg 1
L_0206: ldarg 2
L_020c: call Void SimulationStep_Postfix(Flags, UInt16, Vehicle ByRef)
L_0211: ret
DONE

You might also like