36 {
37 Object targetObject = target.GetObject();
38 Object targetParent = target.GetParent();
39 MotorbikePart motorbikePart = MotorbikePart.Cast(targetObject);
40
41 if (!motorbikePart || !player)
42 return false;
43
45 return true;
46
47 if (motorbikePart)
48 {
49 if (targetParent != null)
50 {
51 InventoryLocation loc = new InventoryLocation();
52 bool isPresent = motorbikePart.GetInventory().GetCurrentInventoryLocation(loc);
53
54 if (!isPresent || loc.
GetSlot() == -1)
55 return false;
56 }
57
58 int zoneHP = motorbikePart.GetHealthLevel("");
59 return zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED;
60 }
61
62 return false;
63 }
proto native int GetSlot()
returns slot id if current type is Attachment