33 {
34 if (!target)
35 return false;
36
38 if (!transport)
39 return false;
40
41 if (transport.IsDamageDestroyed())
42 return false;
43
44 if (item.GetQuantity() <= 0)
45 return false;
46
48 return false;
49
50 if (transport.GetFluidFractionScript(ETransportFluid.FUEL) >= 0.98)
51 return false;
52
54 transport.GetActionComponentNameList(target.GetComponentIndex(), selections);
55
56 foreach (string selection : selections)
57 {
58 if (selection == transport.GetActionCompNameFuel())
59 {
60 float dist =
vector.
DistanceSq(transport.GetRefillPointPosWS(), player.GetPosition());
61
62 if (dist < transport.GetActionDistanceFuel() * transport.GetActionDistanceFuel())
63 return true;
64 }
65 }
66
67 return false;
68 }
Native class for boats - handles physics simulation.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
class array< Class T > TStringArray
const int LIQUID_GASOLINE