diff --git a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/CarLevelOfDetail/IncrementLevel.cs b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/CarLevelOfDetail/IncrementLevel.cs index 8d2c20d..cb94efb 100644 --- a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/CarLevelOfDetail/IncrementLevel.cs +++ b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/CarLevelOfDetail/IncrementLevel.cs @@ -8,20 +8,21 @@ internal class CarLevelOfDetail__IncrementLevel [HarmonyPostfix] internal static void MakeSureSimulationIsOn(CarLevelOfDetail __instance) { - if (__instance.type_ == CarLevelOfDetail.Type.Networked && Mod.Instance.Config.EnableCollision && !Mod.Instance.PlayerFinished) + if (__instance.type_ == CarLevelOfDetail.Type.Networked) { - __instance.SetCarSimulationEnabled(true); - } - else - { - if (Mod.Instance.PlayerFinished) + if (Mod.Instance.Config.EnableCollision && !Mod.Instance.PlayerFinished) { - __instance.SetCarSimulationEnabled(false); - - if (__instance.rigidbody_.isKinematic) + __instance.SetCarSimulationEnabled(true); + } + else + { + if (Mod.Instance.PlayerFinished) { - __instance.rigidbodyStateTransceiver_.setCarOnFixedUpdate_ = false; - __instance.rigidbody_.isKinematic = false; + if (__instance.rigidbody_.isKinematic) + { + __instance.rigidbodyStateTransceiver_.setCarOnFixedUpdate_ = false; + __instance.rigidbody_.isKinematic = false; + } } } } diff --git a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/PlayerDataNet/InitCarVirtual.cs b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/PlayerDataNet/InitCarVirtual.cs index 232cce2..a107fbd 100644 --- a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/PlayerDataNet/InitCarVirtual.cs +++ b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/PlayerDataNet/InitCarVirtual.cs @@ -16,7 +16,7 @@ System.Collections.IEnumerator ActivateCollidersAfterSeconds(float seconds) if (!Mod.Instance.PlayerFinished) { __instance.SetAllColliderLayers(Layers.OnlyPlayer1); - //__instance.CarLOD_.rigidbody_.isKinematic = true; + __instance.CarLOD_.rigidbody_.isKinematic = true; __instance.CarLOD_.SetCarSimulationEnabled(true); } } diff --git a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/RigidbodyStateTransceiver/FixedUpdate.cs b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/RigidbodyStateTransceiver/FixedUpdate.cs index 8f77d8f..928d2dc 100644 --- a/Distance.OnlineAdditions/Harmony/Assembly-CSharp/RigidbodyStateTransceiver/FixedUpdate.cs +++ b/Distance.OnlineAdditions/Harmony/Assembly-CSharp/RigidbodyStateTransceiver/FixedUpdate.cs @@ -10,10 +10,10 @@ internal static bool FixedTheFixedUpdate(RigidbodyStateTransceiver __instance) { if (!__instance.setCarOnFixedUpdate_) return false; - __instance.rigidbody_.transform.position = __instance.posSpring_.Pos_ + __instance.setCarOnFixedUpdateCoef_ * 0.01f * __instance.velSpring_.Pos_; - __instance.rigidbody_.transform.rotation = __instance.rotSpring_.Pos_; - __instance.rigidbody_.velocity = __instance.velSpring_.Pos_; - __instance.rigidbody_.angularVelocity = __instance.rotSpring_.Vel_; + __instance.rigidbody_.MovePosition(__instance.posSpring_.Pos_ + __instance.setCarOnFixedUpdateCoef_ * 0.01f * __instance.velSpring_.Pos_); + __instance.rigidbody_.MoveRotation(__instance.rotSpring_.Pos_); + //__instance.rigidbody_.velocity = __instance.velSpring_.Pos_; + //__instance.rigidbody_.angularVelocity = __instance.rotSpring_.Vel_; return false; } }