public bool TryGetVehicle(out VehicleTag tag)
        {
            InteractableVehicle component = Internal.GetComponent <InteractableVehicle>();

            if (component != null)
            {
                tag = new VehicleTag(component);
                return(true);
            }
            tag = null;
            return(false);
        }
 public bool TryGetVehicle(out VehicleTag tag)
 {
     InteractableVehicle component = Internal.GetComponent<InteractableVehicle>();
     if (component != null)
     {
         tag = new VehicleTag(component);
         return true;
     }
     tag = null;
     return false;
 }
 public static bool VehicleDamaged(InteractableVehicle vehicle, ref ushort amount, ref bool repairable)
 {
     // TODO: causes?
     VehicleTag vehicleTag = new VehicleTag(vehicle);
     if (!repairable && (vehicle.isDead || amount >= vehicle.health))
     {
         VehicleDestroyedEventArgs explodeevt = new VehicleDestroyedEventArgs();
         explodeevt.Vehicle = vehicleTag;
         explodeevt.Amount = new NumberTag(amount);
         explodeevt.Repairable = new BooleanTag(repairable);
         UnturnedFreneticEvents.OnVehicleDestroyed.Fire(explodeevt);
         amount = (ushort)explodeevt.Amount.Internal;
         repairable = explodeevt.Repairable.Internal;
         return explodeevt.Cancelled || EntityDestroyed(vehicleTag, ref amount);
     }
     VehicleDamagedEventArgs evt = new VehicleDamagedEventArgs();
     evt.Vehicle = vehicleTag;
     evt.Amount = new NumberTag(amount);
     evt.Repairable = new BooleanTag(repairable);
     UnturnedFreneticEvents.OnVehicleDamaged.Fire(evt);
     amount = (ushort)evt.Amount.Internal;
     return evt.Cancelled || EntityDamaged(vehicleTag, ref amount);
 }