File tree Expand file tree Collapse file tree
Distance.OnlineAdditions/Harmony/Assembly-CSharp
RigidbodyStateTransceiver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,20 +8,21 @@ internal class CarLevelOfDetail__IncrementLevel
88 [ HarmonyPostfix ]
99 internal static void MakeSureSimulationIsOn ( CarLevelOfDetail __instance )
1010 {
11- if ( __instance . type_ == CarLevelOfDetail . Type . Networked && Mod . Instance . Config . EnableCollision && ! Mod . Instance . PlayerFinished )
11+ if ( __instance . type_ == CarLevelOfDetail . Type . Networked )
1212 {
13- __instance . SetCarSimulationEnabled ( true ) ;
14- }
15- else
16- {
17- if ( Mod . Instance . PlayerFinished )
13+ if ( Mod . Instance . Config . EnableCollision && ! Mod . Instance . PlayerFinished )
1814 {
19- __instance . SetCarSimulationEnabled ( false ) ;
20-
21- if ( __instance . rigidbody_ . isKinematic )
15+ __instance . SetCarSimulationEnabled ( true ) ;
16+ }
17+ else
18+ {
19+ if ( Mod . Instance . PlayerFinished )
2220 {
23- __instance . rigidbodyStateTransceiver_ . setCarOnFixedUpdate_ = false ;
24- __instance . rigidbody_ . isKinematic = false ;
21+ if ( __instance . rigidbody_ . isKinematic )
22+ {
23+ __instance . rigidbodyStateTransceiver_ . setCarOnFixedUpdate_ = false ;
24+ __instance . rigidbody_ . isKinematic = false ;
25+ }
2526 }
2627 }
2728 }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ System.Collections.IEnumerator ActivateCollidersAfterSeconds(float seconds)
1616 if ( ! Mod . Instance . PlayerFinished )
1717 {
1818 __instance . SetAllColliderLayers ( Layers . OnlyPlayer1 ) ;
19- // __instance.CarLOD_.rigidbody_.isKinematic = true;
19+ __instance . CarLOD_ . rigidbody_ . isKinematic = true ;
2020 __instance . CarLOD_ . SetCarSimulationEnabled ( true ) ;
2121 }
2222 }
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ internal static bool FixedTheFixedUpdate(RigidbodyStateTransceiver __instance)
1010 {
1111 if ( ! __instance . setCarOnFixedUpdate_ )
1212 return false ;
13- __instance . rigidbody_ . transform . position = __instance . posSpring_ . Pos_ + __instance . setCarOnFixedUpdateCoef_ * 0.01f * __instance . velSpring_ . Pos_ ;
14- __instance . rigidbody_ . transform . rotation = __instance . rotSpring_ . Pos_ ;
15- __instance . rigidbody_ . velocity = __instance . velSpring_ . Pos_ ;
16- __instance . rigidbody_ . angularVelocity = __instance . rotSpring_ . Vel_ ;
13+ __instance . rigidbody_ . MovePosition ( __instance . posSpring_ . Pos_ + __instance . setCarOnFixedUpdateCoef_ * 0.01f * __instance . velSpring_ . Pos_ ) ;
14+ __instance . rigidbody_ . MoveRotation ( __instance . rotSpring_ . Pos_ ) ;
15+ // __instance.rigidbody_.velocity = __instance.velSpring_.Pos_;
16+ // __instance.rigidbody_.angularVelocity = __instance.rotSpring_.Vel_;
1717 return false ;
1818 }
1919 }
You can’t perform that action at this time.
0 commit comments