private static void Prefix(CarDamageModel __instance, bool set)
 {
     if (NetworkManager.IsClient())
     {
         NetworkTrainPosSync posSync = __instance.trainCar.GetComponent <NetworkTrainPosSync>();
         if (posSync)
         {
             posSync.IsCarDamageEnabled = !set;
         }
     }
 }
 private static void Postfix(LocoControllerBase __instance, ref float __result)
 {
     if (NetworkManager.IsClient() && __instance.train.rb.isKinematic)
     {
         NetworkTrainPosSync networking = __instance.GetComponent <NetworkTrainPosSync>();
         if (networking)
         {
             __result = networking.velocity.magnitude * 3.6f;
         }
     }
 }
Beispiel #3
0
 private static bool Prefix(ShunterLocoSimulation __instance)
 {
     if (NetworkManager.IsClient())
     {
         NetworkTrainPosSync networking = __instance.GetComponent <NetworkTrainPosSync>();
         if (networking)
         {
             return(networking.hasLocalPlayerAuthority);
         }
     }
     return(true);
 }
Beispiel #4
0
 private static bool Prefix(CargoDamageModel __instance, TrainCar ___trainCar, float damage)
 {
     if (NetworkManager.IsClient())
     {
         NetworkTrainPosSync posSync = ___trainCar.GetComponent <NetworkTrainPosSync>();
         if (posSync && !posSync.IsCarDamageEnabled)
         {
             return(false);
         }
     }
     return(true);
 }