10 [
Attribute(
"0.5",
params:
"0 1 0.01",
desc:
"Player can request refuel once fuel in the tank is below this value. (x Max fuel in tank)")]
11 protected float m_fFuelLimit;
15 protected SCR_RefuelTask CreateNewRefuelTask(
int requesterID, IEntity targetVehicle =
null)
23 SetRequester(refuelTask, requester);
24 refuelTask.SetTargetVehicle(targetVehicle);
31 void RequestRefuel(
int requesterID, IEntity vehicle, vector
position)
36 SCR_RefuelTask refuelTask = CreateNewRefuelTask(requesterID, vehicle);
41 MoveTask(
position, refuelTask.GetTaskID());
45 override bool CanRequest()
47 if (!super.CanRequest())
51 if (!localTaskExecutor)
54 if (!
SCR_RefuelTask.CheckRefuelRequestConditions(localTaskExecutor))
61 override void Request()
63 PlayerController playerController =
GetGame().GetPlayerController();
64 if (!playerController)
71 vector
position = ctxMenu.GetMenuWorldPosition();
75 if (!taskNetworkComponent)
81 taskNetworkComponent.RequestRefuel(
position);