Decompiled source of Company Hauler v1.1.2

CompanyHauler/glojam.CompanyHauler.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CompanyHauler.Scripts;
using CompanyHauler.Utils;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;
using glojam.CompanyHauler.NetcodePatcher;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("glojam.CompanyHauler")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyInformationalVersion("1.1.2+63d02a1f2ad578337c54bf68aaf9b5721ede4b39")]
[assembly: AssemblyProduct("CompanyHauler")]
[assembly: AssemblyTitle("glojam.CompanyHauler")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 CompanyHauler
{
	[BepInPlugin("glojam.CompanyHauler", "CompanyHauler", "1.1.2")]
	public class CompanyHauler : BaseUnityPlugin
	{
		public static CompanyHauler Instance { get; private set; }

		internal static ManualLogSource Logger { get; private set; }

		internal static Harmony? Harmony { get; set; }

		internal static HaulerConfig BoundConfig { get; private set; }

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			BoundConfig = new HaulerConfig(((BaseUnityPlugin)this).Config);
			NetcodePatcher();
			Patch();
			Logger.LogInfo((object)"glojam.CompanyHauler v1.1.2 has loaded!");
		}

		internal static void Patch()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			if (Harmony == null)
			{
				Harmony = new Harmony("glojam.CompanyHauler");
			}
			Logger.LogDebug((object)"Patching...");
			Harmony.PatchAll();
			Logger.LogDebug((object)"Finished patching!");
		}

		internal static void Unpatch()
		{
			Logger.LogDebug((object)"Unpatching...");
			Harmony? harmony = Harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Logger.LogDebug((object)"Finished unpatching!");
		}

		private void NetcodePatcher()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}
	}
	internal class HaulerConfig
	{
		public readonly ConfigEntry<bool> haulerMirror;

		public readonly ConfigEntry<int> haulerHealth;

		public readonly ConfigEntry<bool> haulerLean;

		public readonly ConfigEntry<bool> haulerAutoCenter;

		public HaulerConfig(ConfigFile cfg)
		{
			cfg.SaveOnConfigSet = false;
			haulerMirror = cfg.Bind<bool>("General", "MirrorOn", true, "Enable rendering for the side mirrors (may impact performance for low end hardware)");
			haulerHealth = cfg.Bind<int>("General", "Health", 100, "Max health of the Hauler (default: 100). For reference, the Cruiser has a max health of 30.");
			haulerLean = cfg.Bind<bool>("General", "AllowLean", true, "Allow leaning in the driver seat to see out the back window.");
			haulerAutoCenter = cfg.Bind<bool>("General", "AutoCenter", false, "Automatically center the steering wheel");
			ClearOrphanedEntries(cfg);
			cfg.Save();
			cfg.SaveOnConfigSet = true;
		}

		private static void ClearOrphanedEntries(ConfigFile cfg)
		{
			PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg);
			dictionary.Clear();
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "glojam.CompanyHauler";

		public const string PLUGIN_NAME = "CompanyHauler";

		public const string PLUGIN_VERSION = "1.1.2";
	}
}
namespace CompanyHauler.Utils
{
	public static class References
	{
		internal static HaulerController truckController;

		internal static PlayerControllerB lastDriver;

		internal static ItemDropship itemShip;
	}
	public static class VehicleUtils
	{
		public static bool IsPlayerInTruck(PlayerControllerB player, HaulerController vehicle)
		{
			//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)
			Vector3 position = ((Component)player).transform.position;
			Transform overridePhysicsParent = player.overridePhysicsParent;
			Collider component = ((Component)((VehicleController)vehicle).physicsRegion).gameObject.GetComponent<Collider>();
			if ((Object)(object)player == (Object)(object)((VehicleController)vehicle).currentDriver)
			{
				return true;
			}
			if ((Object)(object)player == (Object)(object)((VehicleController)vehicle).currentPassenger)
			{
				return true;
			}
			if ((Object)(object)player == (Object)(object)vehicle.currentBL)
			{
				return true;
			}
			if ((Object)(object)player == (Object)(object)vehicle.currentBR)
			{
				return true;
			}
			return false;
		}

		public static bool IsPlayerProtectedByTruck(PlayerControllerB player, HaulerController vehicle)
		{
			//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)
			bool boolValue = ((VehicleController)vehicle).driverSideDoor.boolValue;
			bool boolValue2 = ((VehicleController)vehicle).passengerSideDoor.boolValue;
			bool boolValue3 = vehicle.BLSideDoor.boolValue;
			bool boolValue4 = vehicle.BRSideDoor.boolValue;
			Vector3 position = ((Component)player).transform.position;
			Transform overridePhysicsParent = player.overridePhysicsParent;
			Collider component = ((Component)((VehicleController)vehicle).physicsRegion).gameObject.GetComponent<Collider>();
			if ((Object)(object)player == (Object)(object)((VehicleController)vehicle).currentDriver && boolValue)
			{
				return false;
			}
			if ((Object)(object)player == (Object)(object)((VehicleController)vehicle).currentPassenger && boolValue2)
			{
				return false;
			}
			if ((Object)(object)player == (Object)(object)vehicle.currentBL && boolValue3)
			{
				return false;
			}
			if ((Object)(object)player == (Object)(object)vehicle.currentBR && boolValue4)
			{
				return false;
			}
			return true;
		}

		public static bool IsLocalPlayer(this PlayerControllerB player)
		{
			return (Object)(object)player == (Object)(object)GameNetworkManager.Instance.localPlayerController;
		}
	}
}
namespace CompanyHauler.Scripts
{
	public class HaulerController : VehicleController
	{
		[CompilerGenerated]
		private sealed class <AlertHorde>d__220 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public HaulerController <>4__this;

			private int <i>5__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <AlertHorde>d__220(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_003e: 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_006a: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<i>5__1 = 0;
					break;
				case 1:
					<>1__state = -1;
					<i>5__1++;
					break;
				}
				if (<i>5__1 < 50)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, 1050f, 1050f, 0, false, 19027);
					<>2__current = (object)new WaitForSeconds(0.1f);
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <RemoveKey>d__163 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public HaulerController <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <RemoveKey>d__163(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected O, but got Unknown
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a1: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(0.26f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					<>4__this.SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false);
					PlayerControllerB currentDriver = ((VehicleController)<>4__this).currentDriver;
					if (currentDriver != null)
					{
						currentDriver.movementAudio.PlayOneShot(((VehicleController)<>4__this).removeKey);
					}
					<>4__this.SetIgnition(started: false);
					<>2__current = (object)new WaitForSeconds(0.73f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					<>4__this.SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: false);
					((VehicleController)<>4__this).keyIgnitionCoroutine = null;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <TryIgnition>d__151 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public bool isLocalDriver;

			public HaulerController <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TryIgnition>d__151(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_018d: Expected O, but got Unknown
				//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Expected O, but got Unknown
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: Expected O, but got Unknown
				//IL_0338: Unknown result type (might be due to invalid IL or missing references)
				//IL_0342: Expected O, but got Unknown
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0216: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (((VehicleController)<>4__this).keyIsInIgnition)
					{
						if (isLocalDriver)
						{
							if (GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.GetInteger("SA_CarAnim") == 3)
							{
								GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
							}
							else
							{
								GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 12);
							}
						}
						<>2__current = (object)new WaitForSeconds(0.02f);
						<>1__state = 1;
						return true;
					}
					if (isLocalDriver)
					{
						GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 2);
					}
					<>4__this.SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: false);
					<>2__current = (object)new WaitForSeconds(0.6f);
					<>1__state = 3;
					return true;
				case 1:
				{
					<>1__state = -1;
					PlayerControllerB currentDriver = ((VehicleController)<>4__this).currentDriver;
					if (currentDriver != null)
					{
						currentDriver.movementAudio.PlayOneShot(((VehicleController)<>4__this).twistKey);
					}
					<>4__this.SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
					<>2__current = (object)new WaitForSeconds(0.1467f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					goto IL_025d;
				case 3:
				{
					<>1__state = -1;
					PlayerControllerB currentDriver3 = ((VehicleController)<>4__this).currentDriver;
					if (currentDriver3 != null)
					{
						currentDriver3.movementAudio.PlayOneShot(((VehicleController)<>4__this).insertKey);
					}
					<>4__this.SetKeyIgnitionValues(trying: false, keyInHand: true, keyInSlot: true);
					((VehicleController)<>4__this).SetFrontCabinLightOn(((VehicleController)<>4__this).keyIsInIgnition);
					<>4__this.ChimeAudio.PlayOneShot(<>4__this.chimeSound);
					<>2__current = (object)new WaitForSeconds(0.2f);
					<>1__state = 4;
					return true;
				}
				case 4:
				{
					<>1__state = -1;
					PlayerControllerB currentDriver2 = ((VehicleController)<>4__this).currentDriver;
					if (currentDriver2 != null)
					{
						currentDriver2.movementAudio.PlayOneShot(((VehicleController)<>4__this).twistKey);
					}
					<>4__this.SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
					goto IL_025d;
				}
				case 5:
					{
						<>1__state = -1;
						if ((float)Random.Range(0, 100) < ((VehicleController)<>4__this).chanceToStartIgnition)
						{
							GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
							<>4__this.SetKeyIgnitionValues(trying: false, keyInHand: false, keyInSlot: true);
							<>4__this.SetIgnition(started: true);
							((VehicleController)<>4__this).SetFrontCabinLightOn(((VehicleController)<>4__this).keyIsInIgnition);
							<>4__this.StartIgnitionServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
						}
						else
						{
							((VehicleController)<>4__this).chanceToStartIgnition = ((VehicleController)<>4__this).chanceToStartIgnition + 15f;
						}
						((VehicleController)<>4__this).keyIgnitionCoroutine = null;
						return false;
					}
					IL_025d:
					<>4__this.SetKeyIgnitionValues(trying: true, keyInHand: true, keyInSlot: true);
					((VehicleController)<>4__this).SetFrontCabinLightOn(((VehicleController)<>4__this).keyIsInIgnition);
					if (!isLocalDriver)
					{
						((VehicleController)<>4__this).keyIgnitionCoroutine = null;
						return false;
					}
					((VehicleController)<>4__this).engineAudio1.Stop();
					((VehicleController)<>4__this).engineAudio1.clip = ((VehicleController)<>4__this).revEngineStart;
					((VehicleController)<>4__this).engineAudio1.volume = 0.7f;
					((VehicleController)<>4__this).engineAudio1.PlayOneShot(((VehicleController)<>4__this).engineRev);
					((VehicleController)<>4__this).carEngine1AudioActive = true;
					<>4__this.RevCarServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId);
					<>2__current = (object)new WaitForSeconds(Random.Range(0.4f, 1.1f));
					<>1__state = 5;
					return true;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[Header("Player Animations")]
		public RuntimeAnimatorController originalController = null;

		public AnimatorOverrideController overrideController = null;

		public RuntimeAnimatorController originalController_pass = null;

		public AnimatorOverrideController overrideController_pass = null;

		public AnimationClip cruiserGearShiftClip = null;

		public AnimationClip cruiserGearShiftIdleClip = null;

		public AnimationClip cruiserSteeringClip = null;

		public AnimationClip cruiserKeyInsertClip = null;

		public AnimationClip cruiserKeyInsertAgainClip = null;

		public AnimationClip cruiserKeyRemoveClip = null;

		public AnimationClip cruiserKeyUntwistClip = null;

		public AnimationClip haulerSitAndSteerNoHandsClip = null;

		public AnimationClip haulerPassengerSitClip = null;

		public AnimationClip haulerColumnShiftClip = null;

		public AnimationClip haulerKeyInsertClip = null;

		public AnimationClip haulerKeyInsertAgainClip = null;

		public AnimationClip haulerKeyRemoveClip = null;

		public AnimationClip haulerKeyUntwistClip = null;

		public bool passReplaced;

		[Header("Vehicle Physics")]
		public List<WheelCollider> wheels = null;

		public Collider truckColliderThingINeedForThatStupidAssBird = null;

		private WheelHit[] wheelHits = (WheelHit[])(object)new WheelHit[4];

		public float clampedLimitTruckVelocity;

		public float sidewaysSlip;

		public float forwardsSlip;

		public float wheelTorque;

		public float wheelBrakeTorque;

		public bool hasDeliveredVehicle;

		public float maxSteeringAngle = 35f;

		public float maxBrakingPower = 2000f;

		public float wheelRPM;

		[Space(5f)]
		[Header("Engine")]
		public bool tryingIgnition;

		[Header("Transmission")]
		public float diffRatio;

		public float forwardWheelSpeed;

		public float reverseWheelSpeed;

		[Header("Multiplayer")]
		public PlayerControllerB currentBL = null;

		public PlayerControllerB currentBR = null;

		public PlayerControllerB currentMiddle = null;

		public InteractTrigger BLSeatTrigger = null;

		public InteractTrigger BRSeatTrigger = null;

		public InteractTrigger MiddleSeatTrigger = null;

		public Transform[] BL_ExitPoints = null;

		public Transform[] BR_ExitPoints = null;

		public AnimatedObjectTrigger BLSideDoor = null;

		public AnimatedObjectTrigger BRSideDoor = null;

		public InteractTrigger BLSideDoorTrigger = null;

		public InteractTrigger BRSideDoorTrigger = null;

		public Vector3 syncedMovementSpeed;

		public float syncedSpeedometerFloat;

		public float syncedWheelRotation;

		public float syncedEngineRPM;

		public float syncedWheelRPM;

		public float syncedMotorTorque;

		public float syncedBrakeTorque;

		public float tyreStress;

		public bool wheelSlipping;

		public float syncCarEffectsInterval;

		public float syncWheelTorqueInterval;

		public float syncCarDrivetrainInterval;

		public float syncCarWheelSpeedInterval;

		public float syncCarDialsEffectInterval;

		public bool localPlayerInBLSeat;

		public bool localPlayerInBRSeat;

		public bool localPlayerInMiddleSeat;

		[Header("Effects")]
		private string[] haulerTooltips = new string[3] { "Gas pedal: [W]", "Brake pedal: [S]", "Lurch: [Space]" };

		public GameObject screensContainer = null;

		public TextMeshProUGUI dotMatrix = null;

		public MeshRenderer leftDial = null;

		public MeshRenderer rightDial = null;

		public Transform leftDialTransform = null;

		public Transform rightDialTransform = null;

		public Image leftDialTickmarks = null;

		public Image rightDialTickmarks = null;

		public GameObject checkEngineLight = null;

		public GameObject tractionControlLight = null;

		public List<GameObject> haulerObjectsToDestroy = null;

		public GameObject mirrorsContainer = null;

		public InteractTrigger redButtonTrigger = null;

		public float speedometerFloat;

		public bool lastKeyInIgnition = false;

		public bool checkEngineWasAlarmed = false;

		public bool tractionLightWasAlarmed = false;

		public float superHornCooldownTime;

		public float superHornCooldownAmount;

		public bool cablightToggle = false;

		public bool cabinLightBoolean = false;

		[Header("Audio")]
		public AudioClip chimeSound = null;

		public AudioClip chimeSoundCritical = null;

		public AudioSource ChimeAudio = null;

		public AudioSource CriticalChimeAudio = null;

		public AudioClip TrainHornAudioClip = null;

		public AudioSource TrainHornAudio = null;

		public AudioSource TrainHornAudioDistant = null;

		public AudioSource roofRainAudio = null;

		[Header("Radio")]
		public float timeLastSyncedRadio;

		public float radioPingTimestamp;

		[Header("Materials")]
		public Material cabinLightOnMat = null;

		public Material cabinLightOffMat = null;

		public Material dialOnMat = null;

		public Material dialOffMat = null;

		public override void OnNetworkSpawn()
		{
			((NetworkBehaviour)this).OnNetworkSpawn();
			if (!StartOfRound.Instance.inShipPhase && ((NetworkBehaviour)this).IsServer)
			{
				base.baseCarHP = CompanyHauler.BoundConfig.haulerHealth.Value;
				base.carHP = base.baseCarHP;
				base.carFragility = 1f;
				SyncHaulerDataServerRpc(base.carHP);
			}
		}

		public void Awake()
		{
			if ((Object)(object)References.truckController == (Object)null)
			{
				References.truckController = this;
			}
			((VehicleController)this).Awake();
			base.ontopOfTruckCollider = truckColliderThingINeedForThatStupidAssBird;
			redButtonTrigger.interactable = false;
			superHornCooldownTime = superHornCooldownAmount;
		}

		private void SetTruckStats()
		{
			//IL_0003: 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)
			base.gear = (CarGearShift)3;
			base.MaxEngineRPM = 400f;
			base.MinEngineRPM = 80f;
			base.engineIntensityPercentage = 400f;
			base.EngineTorque = 1100f;
			base.carAcceleration = 300f;
			base.idleSpeed = 15f;
			base.mainRigidbody.automaticCenterOfMass = false;
			base.mainRigidbody.centerOfMass = new Vector3(0f, -0.25f, 0.5f);
			base.mainRigidbody.automaticInertiaTensor = false;
			base.mainRigidbody.maxDepenetrationVelocity = 1f;
			base.speed = 55f;
			base.stability = 0.55f;
			base.carMaxSpeed = 60f;
			base.mainRigidbody.maxLinearVelocity = base.carMaxSpeed;
			base.mainRigidbody.maxAngularVelocity = 4f;
			base.pushForceMultiplier = 28f;
			base.pushVerticalOffsetAmount = 1f;
			base.steeringWheelTurnSpeed = 4.75f;
			base.torqueForce = 2.5f;
			SetWheelFriction();
			base.FrontLeftWheel.wheelDampingRate = 0.7f;
			base.FrontRightWheel.wheelDampingRate = 0.7f;
			base.BackRightWheel.wheelDampingRate = 0.7f;
			base.BackLeftWheel.wheelDampingRate = 0.7f;
			base.FrontLeftWheel.mass = 45f;
			base.FrontRightWheel.mass = 45f;
			base.BackLeftWheel.mass = 45f;
			base.BackRightWheel.mass = 45f;
		}

		private void SetWheelFriction()
		{
			//IL_0003: 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_004b: 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_005f: 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_0079: 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_00c9: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			WheelFrictionCurve val = default(WheelFrictionCurve);
			((WheelFrictionCurve)(ref val)).extremumSlip = 0.6f;
			((WheelFrictionCurve)(ref val)).extremumValue = 0.75f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 0.5f;
			((WheelFrictionCurve)(ref val)).stiffness = 1f;
			WheelFrictionCurve forwardFriction = val;
			base.FrontRightWheel.forwardFriction = forwardFriction;
			base.FrontLeftWheel.forwardFriction = forwardFriction;
			base.BackRightWheel.forwardFriction = forwardFriction;
			base.BackLeftWheel.forwardFriction = forwardFriction;
			val = default(WheelFrictionCurve);
			((WheelFrictionCurve)(ref val)).extremumSlip = 0.7f;
			((WheelFrictionCurve)(ref val)).extremumValue = 1f;
			((WheelFrictionCurve)(ref val)).asymptoteSlip = 0.8f;
			((WheelFrictionCurve)(ref val)).asymptoteValue = 0.75f;
			((WheelFrictionCurve)(ref val)).stiffness = 0.75f;
			WheelFrictionCurve sidewaysFriction = val;
			base.FrontRightWheel.sidewaysFriction = sidewaysFriction;
			base.FrontLeftWheel.sidewaysFriction = sidewaysFriction;
			base.BackRightWheel.sidewaysFriction = sidewaysFriction;
			base.BackLeftWheel.sidewaysFriction = sidewaysFriction;
		}

		public void Start()
		{
			//IL_0102: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			base.chanceToStartIgnition = 5f;
			base.FrontLeftWheel.brakeTorque = 2000f;
			base.FrontRightWheel.brakeTorque = 2000f;
			base.BackLeftWheel.brakeTorque = 2000f;
			base.BackRightWheel.brakeTorque = 2000f;
			lastKeyInIgnition = true;
			base.currentRadioClip = new Random(StartOfRound.Instance.randomMapSeed).Next(0, base.radioClips.Length);
			base.decals = (DecalProjector[])(object)new DecalProjector[24];
			checkEngineLight.SetActive(false);
			tractionControlLight.SetActive(false);
			mirrorsContainer.SetActive(CompanyHauler.BoundConfig.haulerMirror.Value);
			if (StartOfRound.Instance.inShipPhase)
			{
				base.hasBeenSpawned = true;
				base.magnetedToShip = true;
				base.loadedVehicleFromSave = true;
				hasDeliveredVehicle = true;
				base.inDropshipAnimation = false;
				((Component)this).transform.position = StartOfRound.Instance.magnetPoint.position + StartOfRound.Instance.magnetPoint.forward * 7f;
				StartMagneting();
			}
		}

		public void SendClientSyncData()
		{
			if (((NetworkBehaviour)this).IsServer)
			{
				SyncHaulerDataServerRpc(base.carHP);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncHaulerDataServerRpc(int carHealth)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0089: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1792624853u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, carHealth);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1792624853u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncHaulerDataClientRpc(carHealth);
				}
			}
		}

		[ClientRpc]
		public void SyncHaulerDataClientRpc(int carHealth)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0089: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(518252565u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, carHealth);
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 518252565u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsServer)
				{
					base.baseCarHP = carHealth;
					base.carHP = base.baseCarHP;
					base.carFragility = 1f;
				}
			}
		}

		private void SetCarEffects(float setSteering)
		{
			setSteering = (((NetworkBehaviour)this).IsOwner ? setSteering : 0f);
			base.steeringWheelAnimFloat = Mathf.Clamp(base.steeringWheelAnimFloat + setSteering * base.steeringWheelTurnSpeed * Time.deltaTime / 6f, -1f, 1f);
			base.steeringWheelAnimator.SetFloat("steeringWheelTurnSpeed", Mathf.Clamp((base.steeringWheelAnimFloat + 1f) / 2f, 0f, 1f));
			SetCarAutomaticShifter();
			SetCarLightingEffects();
			SetCarAudioEffects();
			CalculateTyreSlip();
			SetCarDashboardDials();
			MatchWheelMeshToCollider(base.leftWheelMesh, base.FrontLeftWheel);
			MatchWheelMeshToCollider(base.rightWheelMesh, base.FrontRightWheel);
			MatchWheelMeshToCollider(base.backLeftWheelMesh, base.BackLeftWheel);
			MatchWheelMeshToCollider(base.backRightWheelMesh, base.BackRightWheel);
			if (((NetworkBehaviour)this).IsOwner)
			{
				SyncCarEffectsToOtherClients();
				SyncCarDialsEffectsToOtherClients();
				SyncCarDrivetrainToOtherClients();
				SyncCarWheelSpeedToOtherClients();
				SyncCarWheelTorqueToOtherClients();
				speedometerFloat = Mathf.Lerp(speedometerFloat, (base.BackLeftWheel.rotationSpeed + base.BackRightWheel.rotationSpeed) / 2f, 50f * Time.deltaTime / 2f);
				if (!base.syncedExtremeStress && base.underExtremeStress && base.extremeStressAudio.volume > 0.35f)
				{
					base.syncedExtremeStress = true;
					((VehicleController)this).SyncExtremeStressServerRpc(base.underExtremeStress);
				}
				else if (base.syncedExtremeStress && !base.underExtremeStress && base.extremeStressAudio.volume < 0.5f)
				{
					base.syncedExtremeStress = false;
					((VehicleController)this).SyncExtremeStressServerRpc(base.underExtremeStress);
				}
			}
			else
			{
				base.steeringWheelAnimFloat = Mathf.MoveTowards(base.steeringWheelAnimFloat, syncedWheelRotation, base.steeringWheelTurnSpeed * Time.deltaTime / 6f);
				speedometerFloat = Mathf.Lerp(speedometerFloat, syncedSpeedometerFloat, 50f * Time.deltaTime / 2f);
			}
		}

		public void MatchWheelMeshToCollider(MeshRenderer wheelMesh, WheelCollider wheelCollider)
		{
			//IL_0012: 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)
			Vector3 position = default(Vector3);
			Quaternion rotation = default(Quaternion);
			wheelCollider.GetWorldPose(ref position, ref rotation);
			((Component)wheelMesh).transform.rotation = rotation;
			((Component)wheelMesh).transform.position = position;
		}

		public void SyncCarEffectsToOtherClients()
		{
			if (syncCarEffectsInterval > 0.02f)
			{
				if (syncedWheelRotation != base.steeringWheelAnimFloat)
				{
					syncCarEffectsInterval = 0f;
					syncedWheelRotation = base.steeringWheelAnimFloat;
					SyncCarEffectsServerRpc(base.steeringWheelAnimFloat);
				}
			}
			else
			{
				syncCarEffectsInterval += Time.deltaTime;
			}
		}

		public void SyncCarDialsEffectsToOtherClients()
		{
			if (syncCarDialsEffectInterval > 0.14f)
			{
				if (syncedSpeedometerFloat != speedometerFloat)
				{
					syncCarDialsEffectInterval = 0f;
					syncedSpeedometerFloat = speedometerFloat;
					SyncCarDashDialServerRpc(speedometerFloat);
				}
			}
			else
			{
				syncCarDialsEffectInterval += Time.deltaTime;
			}
		}

		public void SyncCarDrivetrainToOtherClients()
		{
			if (!base.ignitionStarted)
			{
				return;
			}
			if (syncCarDrivetrainInterval > 0.12f)
			{
				int num = Mathf.RoundToInt(base.EngineRPM / 10f);
				if (syncedEngineRPM != (float)num)
				{
					syncCarDrivetrainInterval = 0f;
					syncedEngineRPM = num;
					SyncCarDrivetrainServerRpc(num);
				}
			}
			else
			{
				syncCarDrivetrainInterval += Time.deltaTime;
			}
		}

		public void SyncCarWheelSpeedToOtherClients()
		{
			if (syncCarWheelSpeedInterval > 0.185f)
			{
				if (syncedWheelRPM != wheelRPM)
				{
					syncCarWheelSpeedInterval = 0f;
					syncedWheelRPM = wheelRPM;
					SyncCarWheelSpeedServerRpc(wheelRPM);
				}
			}
			else
			{
				syncCarWheelSpeedInterval += Time.deltaTime;
			}
		}

		public void SyncCarWheelTorqueToOtherClients()
		{
			if (syncWheelTorqueInterval > 0.16f)
			{
				if (syncedMotorTorque != base.FrontLeftWheel.motorTorque || syncedBrakeTorque != base.FrontLeftWheel.brakeTorque)
				{
					syncWheelTorqueInterval = 0f;
					syncedMotorTorque = base.FrontLeftWheel.motorTorque;
					syncedBrakeTorque = base.FrontLeftWheel.brakeTorque;
					SyncWheelTorqueServerRpc(base.FrontLeftWheel.motorTorque, base.FrontLeftWheel.brakeTorque);
				}
			}
			else
			{
				syncWheelTorqueInterval += Time.deltaTime;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncCarDrivetrainServerRpc(float engineSpeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1022842192u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref engineSpeed, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1022842192u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncCarDrivetrainClientRpc(engineSpeed);
				}
			}
		}

		[ClientRpc]
		public void SyncCarDrivetrainClientRpc(float engineSpeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2047208583u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref engineSpeed, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2047208583u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					syncedEngineRPM = engineSpeed * 10f;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncCarWheelSpeedServerRpc(float wheelSpeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3249451087u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelSpeed, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3249451087u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncCarWheelSpeedClientRpc(wheelSpeed);
				}
			}
		}

		[ClientRpc]
		public void SyncCarWheelSpeedClientRpc(float wheelSpeed)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3390899288u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelSpeed, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3390899288u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					syncedWheelRPM = wheelSpeed;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncCarDashDialServerRpc(float speedFloat)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3335680402u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedFloat, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3335680402u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncCarDashDialClientRpc(speedFloat);
				}
			}
		}

		[ClientRpc]
		public void SyncCarDashDialClientRpc(float speedFloat)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3046174349u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref speedFloat, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3046174349u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					syncedSpeedometerFloat = speedFloat;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncCarEffectsServerRpc(float wheelRotation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2364400821u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelRotation, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2364400821u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncCarEffectsClientRpc(wheelRotation);
				}
			}
		}

		[ClientRpc]
		public void SyncCarEffectsClientRpc(float wheelRotation)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1293786616u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelRotation, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1293786616u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					syncedWheelRotation = wheelRotation;
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SyncWheelTorqueServerRpc(float motorTorque, float brakeTorque)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(955214015u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref motorTorque, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref brakeTorque, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 955214015u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SyncWheelTorqueClientRpc(motorTorque, brakeTorque);
				}
			}
		}

		[ClientRpc]
		public void SyncWheelTorqueClientRpc(float motorTorque, float brakeTorque)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1980440110u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref motorTorque, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref brakeTorque, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1980440110u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					syncedMotorTorque = motorTorque;
					syncedBrakeTorque = brakeTorque;
				}
			}
		}

		public void SetCarAutomaticShifter()
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: 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_001e: Expected I4, but got Unknown
			CarGearShift gear = base.gear;
			CarGearShift val = gear;
			switch (val - 1)
			{
			case 2:
				base.gearStickAnimValue = Mathf.MoveTowards(base.gearStickAnimValue, 1f, 15f * Time.deltaTime * (Time.realtimeSinceStartup - base.timeAtLastGearShift));
				break;
			case 1:
				base.gearStickAnimValue = Mathf.MoveTowards(base.gearStickAnimValue, 0.5f, 15f * Time.deltaTime * (Time.realtimeSinceStartup - base.timeAtLastGearShift));
				break;
			case 0:
				base.gearStickAnimValue = Mathf.MoveTowards(base.gearStickAnimValue, 0f, 15f * Time.deltaTime * (Time.realtimeSinceStartup - base.timeAtLastGearShift));
				break;
			}
			base.gearStickAnimator.SetFloat("gear", Mathf.Clamp(base.gearStickAnimValue, 0.01f, 0.99f));
		}

		public void SetCarLightingEffects()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			bool flag = (base.FrontLeftWheel.brakeTorque + base.FrontRightWheel.brakeTorque) / 2f > 100f && base.ignitionStarted && (int)base.gear != 3;
			if (base.backLightsOn != flag)
			{
				base.backLightsOn = flag;
				((Renderer)base.backLightsMesh).material = (flag ? base.backLightOnMat : base.headlightsOffMat);
				base.backLightsContainer.SetActive(flag);
			}
		}

		public void SetCarAudioEffects()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: 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)
			bool flag = (int)TimeOfDay.Instance.currentLevelWeather == 1 || (int)TimeOfDay.Instance.currentLevelWeather == 4 || (int)TimeOfDay.Instance.currentLevelWeather == 2;
			float num = Mathf.Clamp(base.EngineRPM / base.engineIntensityPercentage, 0.65f, 1.15f);
			float num2 = Mathf.Clamp(base.EngineRPM / base.engineIntensityPercentage, 0.7f, 1.5f);
			float num3 = Mathf.Abs(wheelRPM);
			float num4 = Mathf.Clamp(num3 / 63f, 0f, 1f);
			base.carEngine2AudioActive = base.ignitionStarted;
			base.carRollingAudioActive = (base.FrontLeftWheel.isGrounded || base.FrontRightWheel.isGrounded || base.BackLeftWheel.isGrounded || base.BackRightWheel.isGrounded) && num3 > 10f;
			if (!base.ignitionStarted)
			{
				num = 1f;
			}
			((VehicleController)this).SetVehicleAudioProperties(base.engineAudio1, base.carEngine1AudioActive, 0.7f, num, 2f, false, 0.7f);
			((VehicleController)this).SetVehicleAudioProperties(base.engineAudio2, base.carEngine2AudioActive, 0.7f, num2, 3f, false, 0.5f);
			((VehicleController)this).SetVehicleAudioProperties(base.rollingAudio, base.carRollingAudioActive, 0f, num4, 5f, true, 1f);
			((VehicleController)this).SetVehicleAudioProperties(base.extremeStressAudio, base.underExtremeStress, 0.2f, 1f, 3f, true, 1f);
			SetRadioValues();
			if (flag && !roofRainAudio.isPlaying)
			{
				roofRainAudio.Play();
			}
			else if (!flag && roofRainAudio.isPlaying)
			{
				roofRainAudio.Stop();
			}
			if (base.engineAudio1.volume > 0.3f && base.engineAudio1.isPlaying && Time.realtimeSinceStartup - base.timeAtLastEngineAudioPing > 2f)
			{
				base.timeAtLastEngineAudioPing = Time.realtimeSinceStartup;
				if (base.EngineRPM > 130f)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 32f, 0.75f, 0, false, 2692);
				}
				if (base.EngineRPM > 60f && base.EngineRPM < 130f)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 25f, 0.6f, 0, false, 2692);
				}
				else if (!base.ignitionStarted)
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 15f, 0.6f, 0, false, 2692);
				}
				else
				{
					RoundManager.Instance.PlayAudibleNoise(((Component)base.engineAudio1).transform.position, 11f, 0.5f, 0, false, 2692);
				}
			}
			base.turbulenceAudio.volume = Mathf.Lerp(base.turbulenceAudio.volume, Mathf.Min(1f, base.turbulenceAmount), 10f * Time.deltaTime);
			base.turbulenceAmount = Mathf.Max(base.turbulenceAmount - Time.deltaTime, 0f);
			if (base.turbulenceAudio.volume > 0.02f)
			{
				if (!base.turbulenceAudio.isPlaying)
				{
					base.turbulenceAudio.Play();
				}
			}
			else if (base.turbulenceAudio.isPlaying)
			{
				base.turbulenceAudio.Stop();
			}
			if (base.honkingHorn)
			{
				base.hornAudio.pitch = 1f;
				if (!base.hornAudio.isPlaying)
				{
					base.hornAudio.Play();
				}
				if (Time.realtimeSinceStartup - base.timeAtLastHornPing > 2f)
				{
					base.timeAtLastHornPing = Time.realtimeSinceStartup;
					RoundManager.Instance.PlayAudibleNoise(((Component)base.hornAudio).transform.position, 28f, 0.85f, 0, false, 106217);
				}
			}
			else
			{
				base.hornAudio.pitch = Mathf.Max(base.hornAudio.pitch - Time.deltaTime * 6f, 0.01f);
				if (base.hornAudio.pitch < 0.02f)
				{
					base.hornAudio.Stop();
				}
			}
		}

		public void CalculateTyreSlip()
		{
			//IL_0015: 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_0024: 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)
			if (((NetworkBehaviour)this).IsOwner)
			{
				float num = Vector3.Dot(Vector3.Normalize(base.mainRigidbody.velocity * 1000f), ((Component)this).transform.forward);
				float num2 = Mathf.Abs(wheelRPM);
				bool flag = num > -0.6f && num < 0.4f && (((Vector3)(ref base.averageVelocity)).magnitude > 4f || num2 > 65f);
				if (base.BackLeftWheel.isGrounded && base.BackRightWheel.isGrounded)
				{
					WheelHit[] array = (WheelHit[])(object)new WheelHit[2];
					base.BackLeftWheel.GetGroundHit(ref array[0]);
					base.BackRightWheel.GetGroundHit(ref array[1]);
					if (base.BackLeftWheel.motorTorque > 900f && base.BackRightWheel.motorTorque > 900f && (Mathf.Abs(((WheelHit)(ref array[0])).forwardSlip) > 0.2f || Mathf.Abs(((WheelHit)(ref array[1])).forwardSlip) > 0.2f))
					{
						num = Mathf.Max(num, 0.8f);
						flag = true;
						if (((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying)
						{
							base.tireSparks.Play(true);
						}
					}
					else
					{
						flag = false;
						base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1);
					}
				}
				else
				{
					flag = false;
					base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1);
				}
				((VehicleController)this).SetVehicleAudioProperties(base.skiddingAudio, flag, 0f, num, 3f, true, 1f);
				if (Mathf.Abs(tyreStress - num) > 0.04f || wheelSlipping != flag)
				{
					SetTyreStressOnServerRpc(num, flag);
				}
				return;
			}
			if (wheelSlipping)
			{
				if (((Vector3)(ref base.averageVelocity)).magnitude > 8f && !base.tireSparks.isPlaying)
				{
					base.tireSparks.Play(true);
				}
			}
			else
			{
				base.tireSparks.Stop(true, (ParticleSystemStopBehavior)1);
			}
			((VehicleController)this).SetVehicleAudioProperties(base.skiddingAudio, wheelSlipping, 0f, tyreStress, 3f, true, 1f);
		}

		public void SetCarDashboardDials()
		{
			//IL_0053: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: 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)
			if (lastKeyInIgnition != base.keyIsInIgnition)
			{
				lastKeyInIgnition = base.keyIsInIgnition;
				Color color = (base.keyIsInIgnition ? new Color(0.33f, 0.84f, 0.83f) : new Color(0.11f, 0.33f, 0.33f));
				Material[] materials = (Material[])(object)((!base.keyIsInIgnition) ? new Material[1] { dialOffMat } : new Material[1] { dialOnMat });
				screensContainer.SetActive(base.keyIsInIgnition);
				((Renderer)leftDial).materials = materials;
				((Renderer)rightDial).materials = materials;
				((Graphic)leftDialTickmarks).color = color;
				((Graphic)rightDialTickmarks).color = color;
			}
			if (base.tireSparks.isEmitting && !tractionLightWasAlarmed && base.keyIsInIgnition)
			{
				tractionLightWasAlarmed = true;
				tractionControlLight.SetActive(true);
			}
			else if (!base.tireSparks.isEmitting && tractionLightWasAlarmed)
			{
				tractionLightWasAlarmed = false;
				tractionControlLight.SetActive(false);
			}
			if ((float)base.carHP / (float)base.baseCarHP < 0.5f && !checkEngineWasAlarmed && base.keyIsInIgnition)
			{
				checkEngineWasAlarmed = true;
				checkEngineLight.SetActive(true);
				ChimeAudio.PlayOneShot(chimeSoundCritical);
			}
			else if ((float)base.carHP / (float)base.baseCarHP > 0.5f && checkEngineWasAlarmed)
			{
				checkEngineWasAlarmed = false;
				checkEngineLight.SetActive(false);
			}
			if (base.keyIsInIgnition)
			{
				((TMP_Text)dotMatrix).text = ((TMP_Text)HUDManager.Instance.clockNumber).text.Trim().Replace("\n", " ");
			}
			if ((Object)(object)base.BackLeftWheel != (Object)null && (Object)(object)base.BackRightWheel != (Object)null)
			{
				leftDialTransform.localRotation = Quaternion.Euler(Mathf.Lerp(-219f, -10f, Mathf.Abs(base.EngineRPM) / (base.MaxEngineRPM / 2.5f)) + (base.ignitionStarted ? 25f : 0f), 90f, 90f);
				rightDialTransform.localRotation = Quaternion.Euler(Mathf.Lerp(11f, -203f, Mathf.Abs(speedometerFloat) / 5000f), 270f, -90f);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SetTyreStressOnServerRpc(float wheelStress, bool wheelSkidding)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3108067533u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelStress, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref wheelSkidding, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3108067533u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
					SetTyreStressOnLocalClientRpc(wheelStress, wheelSkidding);
				}
			}
		}

		[ClientRpc]
		public void SetTyreStressOnLocalClientRpc(float wheelStress, bool wheelSkidding)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_0083: 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_009e: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(514041044u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref wheelStress, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref wheelSkidding, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 514041044u, val, (RpcDelivery)0);
			}
			if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
				if (!((NetworkBehaviour)this).IsOwner)
				{
					tyreStress = wheelStress;
					wheelSlipping = wheelSkidding;
				}
			}
		}

		public void FixedUpdate()
		{
			//IL_003b: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: 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_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: 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_02ce: 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_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: 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_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: 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_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: 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_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: 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_0408: Unknown result type (might be due to invalid IL or missing references)
			//IL_041a: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: 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_0510: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: 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_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: 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_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: 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_06fd: Expected I4, but got Unknown
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Invalid comparison between Unknown and I4
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ba: Invalid comparison between Unknown and I4
			//IL_0847: Unknown result type (might be due to invalid IL or missing references)
			//IL_084d: Invalid comparison between Unknown and I4
			WheelHit val = default(WheelHit);
			for (int i = 0; i < wheels.Count; i++)
			{
				if (wheels[i].GetGroundHit(ref val))
				{
					wheelHits[i] = val;
				}
				else
				{
					wheelHits[i] = default(WheelHit);
				}
			}
			if (!StartOfRound.Instance.inShipPhase && !base.loadedVehicleFromSave && !hasDeliveredVehicle)
			{
				if ((Object)(object)base.itemShip == (Object)null && (Object)(object)References.itemShip != (Object)null)
				{
					base.itemShip = References.itemShip;
				}
				if ((Object)(object)base.itemShip != (Object)null)
				{
					if (base.itemShip.untetheredVehicle)
					{
						base.inDropshipAnimation = false;
						base.mainRigidbody.MovePosition(base.itemShip.deliverVehiclePoint.position);
						base.mainRigidbody.MoveRotation(base.itemShip.deliverVehiclePoint.rotation);
						base.syncedPosition = ((Component)this).transform.position;
						base.syncedRotation = ((Component)this).transform.rotation;
						base.hasBeenSpawned = true;
						hasDeliveredVehicle = true;
					}
					else if (base.itemShip.deliveringVehicle)
					{
						base.inDropshipAnimation = true;
						base.mainRigidbody.isKinematic = true;
						base.mainRigidbody.MovePosition(base.itemShip.deliverVehiclePoint.position);
						base.mainRigidbody.MoveRotation(base.itemShip.deliverVehiclePoint.rotation);
						base.syncedPosition = ((Component)this).transform.position;
						base.syncedRotation = ((Component)this).transform.rotation;
					}
				}
				else if ((Object)(object)base.itemShip == (Object)null)
				{
					base.inDropshipAnimation = false;
					base.mainRigidbody.isKinematic = true;
					base.mainRigidbody.MovePosition(StartOfRound.Instance.notSpawnedPosition.position + Vector3.forward * 30f);
					base.syncedPosition = ((Component)this).transform.position;
					base.syncedRotation = ((Component)this).transform.rotation;
				}
			}
			if (base.magnetedToShip)
			{
				base.syncedPosition = ((Component)this).transform.position;
				base.syncedRotation = ((Component)this).transform.rotation;
				base.mainRigidbody.MovePosition(Vector3.Lerp(base.magnetStartPosition, StartOfRound.Instance.elevatorTransform.position + base.magnetTargetPosition, base.magnetPositionCurve.Evaluate(base.magnetTime)));
				base.mainRigidbody.MoveRotation(Quaternion.Lerp(base.magnetStartRotation, base.magnetTargetRotation, base.magnetRotationCurve.Evaluate(base.magnetRotationTime)));
				base.averageVelocityAtMagnetStart = Vector3.Lerp(base.averageVelocityAtMagnetStart, Vector3.ClampMagnitude(base.averageVelocityAtMagnetStart, 4f), 4f * Time.deltaTime);
				if (!base.finishedMagneting)
				{
					base.magnetStartPosition += Vector3.ClampMagnitude(base.averageVelocityAtMagnetStart, 5f) * Time.fixedDeltaTime;
				}
			}
			else if (!((NetworkBehaviour)this).IsOwner && !base.inDropshipAnimation)
			{
				((Component)this).gameObject.GetComponent<Rigidbody>().isKinematic = true;
				Mathf.Clamp(base.syncSpeedMultiplier * Vector3.Distance(((Component)this).transform.position, base.syncedPosition), 1.3f, 300f);
				Vector3 val2 = Vector3.Lerp(((Component)this).transform.position, base.syncedPosition, Time.fixedDeltaTime * base.syncSpeedMultiplier);
				base.mainRigidbody.MovePosition(val2);
				base.mainRigidbody.MoveRotation(Quaternion.Lerp(((Component)this).transform.rotation, base.syncedRotation, base.syncRotationSpeed));
				base.truckVelocityLastFrame = base.mainRigidbody.velocity;
			}
			base.averageVelocity += (base.mainRigidbody.velocity - base.averageVelocity) / (float)(base.movingAverageLength + 1);
			base.ragdollPhysicsBody.Move(((Component)this).transform.position, ((Component)this).transform.rotation);
			base.windwiperPhysicsBody1.Move(base.windwiper1.position, base.windwiper1.rotation);
			base.windwiperPhysicsBody2.Move(base.windwiper2.position, base.windwiper2.rotation);
			if (!base.hasBeenSpawned || base.carDestroyed)
			{
				return;
			}
			Vector3 angularVelocity = base.mainRigidbody.angularVelocity;
			Vector3 val3 = Vector3.Cross(Quaternion.AngleAxis(((Vector3)(ref angularVelocity)).magnitude * 57.29578f * base.stability / base.speed, base.mainRigidbody.angularVelocity) * ((Component)this).transform.up, Vector3.up);
			base.mainRigidbody.AddTorque(val3 * base.speed * base.speed);
			if (((Collider)base.FrontLeftWheel).enabled && ((Collider)base.FrontRightWheel).enabled && ((Collider)base.BackLeftWheel).enabled && ((Collider)base.BackRightWheel).enabled)
			{
				base.FrontLeftWheel.steerAngle = maxSteeringAngle * base.steeringWheelAnimFloat;
				base.FrontRightWheel.steerAngle = maxSteeringAngle * base.steeringWheelAnimFloat;
				if (((NetworkBehaviour)this).IsOwner)
				{
					wheelRPM = (base.FrontLeftWheel.rpm + base.FrontRightWheel.rpm + base.BackLeftWheel.rpm + base.BackRightWheel.rpm) / 4f;
					float num = 0f;
					if (base.ignitionStarted)
					{
						if (base.brakePedalPressed)
						{
							base.FrontLeftWheel.brakeTorque = 2000f;
							base.FrontRightWheel.brakeTorque = 2000f;
							base.BackLeftWheel.brakeTorque = 2000f;
							base.BackRightWheel.brakeTorque = 2000f;
						}
						else
						{
							base.FrontLeftWheel.brakeTorque = 0f;
							base.FrontRightWheel.brakeTorque = 0f;
							base.BackLeftWheel.brakeTorque = 0f;
							base.BackRightWheel.brakeTorque = 0f;
						}
					}
					if (base.drivePedalPressed && base.ignitionStarted)
					{
						CarGearShift gear = base.gear;
						CarGearShift val4 = gear;
						switch (val4 - 1)
						{
						case 2:
							num += 1.2f;
							base.lastStressType += "; Accelerating while in park";
							break;
						case 1:
							base.FrontLeftWheel.motorTorque = 0f - base.EngineTorque;
							base.FrontRightWheel.motorTorque = 0f - base.EngineTorque;
							base.BackLeftWheel.motorTorque = 0f - base.EngineTorque;
							base.BackRightWheel.motorTorque = 0f - base.EngineTorque;
							break;
						case 0:
							base.FrontLeftWheel.motorTorque = Mathf.Clamp(Mathf.MoveTowards(base.FrontLeftWheel.motorTorque, base.EngineTorque, base.carAcceleration * Time.deltaTime), 325f, 1000f);
							base.FrontRightWheel.motorTorque = base.FrontLeftWheel.motorTorque;
							base.BackLeftWheel.motorTorque = base.FrontLeftWheel.motorTorque;
							base.BackRightWheel.motorTorque = base.FrontLeftWheel.motorTorque;
							break;
						}
					}
					else if (!base.drivePedalPressed && base.ignitionStarted && (int)base.gear != 3)
					{
						float num2 = 1f;
						if ((int)base.gear == 2)
						{
							num2 = -1f;
						}
						base.FrontLeftWheel.motorTorque = base.idleSpeed * num2;
						base.FrontRightWheel.motorTorque = base.idleSpeed * num2;
						base.BackLeftWheel.motorTorque = base.idleSpeed * num2;
						base.BackRightWheel.motorTorque = base.idleSpeed * num2;
					}
					if ((int)base.gear == 3 || !base.ignitionStarted)
					{
						if (base.BackLeftWheel.isGrounded && base.BackRightWheel.isGrounded && ((Vector3)(ref base.averageVelocity)).magnitude > 18f)
						{
							num += Mathf.Clamp((((Vector3)(ref base.averageVelocity)).magnitude * 165f - 200f) / 150f, 0f, 4f);
							base.lastStressType += "; In park while at high speed";
						}
						base.FrontLeftWheel.motorTorque = 0f;
						base.FrontRightWheel.motorTorque = 0f;
						base.BackLeftWheel.motorTorque = 0f;
						base.BackRightWheel.motorTorque = 0f;
						base.FrontLeftWheel.brakeTorque = 2000f;
						base.FrontRightWheel.brakeTorque = 2000f;
						base.BackLeftWheel.brakeTorque = 2000f;
						base.BackRightWheel.brakeTorque = 2000f;
					}
					SetInternalStress(num);
					base.stressPerSecond = num;
				}
				else
				{
					wheelRPM = Mathf.Lerp(wheelRPM, syncedWheelRPM, Time.deltaTime * 8f);
					base.FrontLeftWheel.motorTorque = syncedMotorTorque;
					base.FrontRightWheel.motorTorque = syncedMotorTorque;
					base.BackLeftWheel.motorTorque = syncedMotorTorque;
					base.BackRightWheel.motorTorque = syncedMotorTorque;
					base.FrontLeftWheel.brakeTorque = syncedBrakeTorque;
					base.FrontRightWheel.brakeTorque = syncedBrakeTorque;
					base.BackLeftWheel.brakeTorque = syncedBrakeTorque;
					base.BackRightWheel.brakeTorque = syncedBrakeTorque;
				}
			}
			if (base.ignitionStarted)
			{
				if (((Collider)base.FrontLeftWheel).enabled && ((Collider)base.FrontRightWheel).enabled && ((Collider)base.BackLeftWheel).enabled && ((Collider)base.BackRightWheel).enabled)
				{
					forwardWheelSpeed = 6000f;
					reverseWheelSpeed = -6000f;
					base.FrontLeftWheel.rotationSpeed = Mathf.Clamp(base.FrontLeftWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed);
					base.FrontRightWheel.rotationSpeed = Mathf.Clamp(base.FrontRightWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed);
					base.BackLeftWheel.rotationSpeed = Mathf.Clamp(base.BackLeftWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed);
					base.BackRightWheel.rotationSpeed = Mathf.Clamp(base.BackRightWheel.rotationSpeed, reverseWheelSpeed, forwardWheelSpeed);
				}
				if (((NetworkBehaviour)this).IsOwner)
				{
					base.EngineRPM = Mathf.Abs((base.FrontLeftWheel.rpm + base.FrontRightWheel.rpm + base.BackLeftWheel.rpm + base.BackRightWheel.rpm) / 4f);
				}
				else
				{
					base.EngineRPM = Mathf.Lerp(base.EngineRPM, syncedEngineRPM, Time.deltaTime * 5f);
				}
			}
			else
			{
				base.EngineRPM = Mathf.Lerp(base.EngineRPM, 0f, 3f * Time.deltaTime);
			}
		}

		public void Update()
		{
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0524: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: 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_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_0761: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d7: Unknown result type (might be due to invalid IL or missing references)
			if (base.destroyNextFrame)
			{
				if (((NetworkBehaviour)this).IsOwner)
				{
					Object.Destroy((Object)(object)((Component)base.windwiperPhysicsBody1).gameObject);
					Object.Destroy((Object)(object)((Component)base.windwiperPhysicsBody2).gameObject);
					Object.Destroy((Object)(object)((Component)base.ragdollPhysicsBody).gameObject);
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
			else if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && !((NetworkBehaviour)this).NetworkObject.IsSpawned)
			{
				base.physicsRegion.disablePhysicsRegion = true;
				if (StartOfRound.Instance.CurrentPlayerPhysicsRegions.Contains(base.physicsRegion))
				{
					StartOfRound.Instance.CurrentPlayerPhysicsRegions.Remove(base.physicsRegion);
				}
				if (base.localPlayerInControl || base.localPlayerInPassengerSeat || localPlayerInBLSeat || localPlayerInBRSeat || localPlayerInMiddleSeat)
				{
					GameNetworkManager.Instance.localPlayerController.CancelSpecialTriggerAnimations();
				}
				GrabbableObject[] componentsInChildren = ((Component)base.physicsRegion.physicsTransform).GetComponentsInChildren<GrabbableObject>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					if ((Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null)
					{
						((Component)componentsInChildren[i]).transform.SetParent(RoundManager.Instance.mapPropsContainer.transform, true);
					}
					else
					{
						((Component)componentsInChildren[i]).transform.SetParent((Transform)null, true);
					}
					if (!componentsInChildren[i].isHeld)
					{
						componentsInChildren[i].FallToGround(false, false, default(Vector3));
					}
				}
				base.destroyNextFrame = true;
			}
			else
			{
				if (!base.hasBeenSpawned)
				{
					return;
				}
				if (base.magnetedToShip)
				{
					if (!StartOfRound.Instance.magnetOn)
					{
						base.magnetedToShip = false;
						StartOfRound.Instance.isObjectAttachedToMagnet = false;
						CollectItemsInHauler();
						return;
					}
					base.magnetTime = Mathf.Min(base.magnetTime + Time.deltaTime, 1f);
					base.magnetRotationTime = Mathf.Min(base.magnetTime + Time.deltaTime * 0.75f, 1f);
					if (!base.finishedMagneting && base.magnetTime > 0.7f)
					{
						base.finishedMagneting = true;
						base.turbulenceAmount = 2f;
						base.turbulenceAudio.volume = 0.6f;
						base.turbulenceAudio.PlayOneShot(base.maxCollisions[Random.Range(0, base.maxCollisions.Length)]);
					}
				}
				else
				{
					base.finishedMagneting = false;
					if ((Object)(object)StartOfRound.Instance.attachedVehicle == (Object)(object)this)
					{
						StartOfRound.Instance.attachedVehicle = null;
					}
					if (((NetworkBehaviour)this).IsOwner && !base.carDestroyed && !StartOfRound.Instance.isObjectAttachedToMagnet && StartOfRound.Instance.magnetOn && Vector3.Distance(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position) < 10f && !Physics.Linecast(((Component)this).transform.position, StartOfRound.Instance.magnetPoint.position, 256, (QueryTriggerInteraction)1))
					{
						StartMagneting();
						return;
					}
					if (((NetworkBehaviour)this).IsOwner)
					{
						if (base.enabledCollisionForAllPlayers)
						{
							base.enabledCollisionForAllPlayers = false;
							((VehicleController)this).DisableVehicleCollisionForAllPlayers();
						}
						if (!base.inDropshipAnimation)
						{
							SyncCarPositionToOtherClients();
						}
					}
					else if (!base.enabledCollisionForAllPlayers)
					{
						base.enabledCollisionForAllPlayers = true;
						((VehicleController)this).EnableVehicleCollisionForAllPlayers();
					}
				}
				ReactToDamage();
				if (base.carDestroyed)
				{
					return;
				}
				if (!redButtonTrigger.interactable)
				{
					if (superHornCooldownTime <= 0f)
					{
						redButtonTrigger.interactable = true;
						return;
					}
					redButtonTrigger.disabledHoverTip = $"[Recharging: {(int)superHornCooldownTime} sec.]";
					superHornCooldownTime -= Time.deltaTime;
				}
				base.driverSideDoorTrigger.interactable = Time.realtimeSinceStartup - base.timeSinceSpringingDriverSeat > 1.6f;
				base.passengerSideDoorTrigger.interactable = Time.realtimeSinceStartup - base.timeSinceSpringingDriverSeat > 1.6f;
				BLSideDoorTrigger.interactable = Time.realtimeSinceStartup - base.timeSinceSpringingDriverSeat > 1.6f;
				BRSideDoorTrigger.interactable = Time.realtimeSinceStartup - base.timeSinceSpringingDriverSeat > 1.6f;
				if (base.keyIsInDriverHand && (Object)(object)base.currentDriver != (Object)null)
				{
					((Renderer)base.keyObject).enabled = true;
					Transform val = ((!base.localPlayerInControl) ? base.currentDriver.serverItemHolder : base.currentDriver.localItemHolder);
					((Component)base.keyObject).transform.rotation = val.rotation;
					((Component)base.keyObject).transform.Rotate(base.rotationOffset);
					((Component)base.keyObject).transform.position = val.position;
					Vector3 positionOffset = base.positionOffset;
					positionOffset = val.rotation * positionOffset;
					Transform transform = ((Component)base.keyObject).transform;
					transform.position += positionOffset;
				}
				else
				{
					if (Time.realtimeSinceStartup - base.timeAtLastGearShift < 1.7f && (Object)(object)base.currentDriver != (Object)null)
					{
						base.currentDriver.playerBodyAnimator.SetFloat("SA_CarMotionTime", base.gearStickAnimValue);
					}
					if (base.localPlayerInControl && base.ignitionStarted && base.keyIgnitionCoroutine == null)
					{
						GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetFloat("animationSpeed", base.steeringWheelAnimFloat + 0.5f);
						if (Time.realtimeSinceStartup - base.timeAtLastGearShift < 1.7f)
						{
							GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 5);
						}
						else
						{
							GameNetworkManager.Instance.localPlayerController.playerBodyAnimator.SetInteger("SA_CarAnim", 1);
						}
					}
					if (base.keyIsInIgnition)
					{
						((Renderer)base.keyObject).enabled = true;
						if (base.ignitionStarted)
						{
							((Component)base.keyObject).transform.position = base.ignitionTurnedPosition.position;
							((Component)base.key