2015-11-21 22:24:24 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Resets a fuel vehicle in case is got bugged
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Fuel truck <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [truck] call ace_refuel_fnc_reset
|
|
|
|
*
|
2016-02-25 09:08:20 +00:00
|
|
|
* Public: Yes
|
2015-11-21 22:24:24 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
params [["_target", objNull, [objNull]]];
|
2015-11-21 22:24:24 +00:00
|
|
|
|
2016-05-03 19:08:22 +00:00
|
|
|
[_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set);
|
2015-11-21 22:24:24 +00:00
|
|
|
_target setVariable [QGVAR(isConnected), false, true];
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
private _nozzle = _target getVariable [QGVAR(ownedNozzle), nil];
|
2015-11-21 22:24:24 +00:00
|
|
|
if !(isNil "_nozzle") then {
|
2016-02-02 14:03:06 +00:00
|
|
|
private _nozzleTarget = _nozzle getVariable [QGVAR(sink), nil];
|
2015-11-21 22:24:24 +00:00
|
|
|
if !(isNil "_nozzleTarget") then {
|
|
|
|
_nozzleTarget setVariable [QGVAR(nozzle), nil, true];
|
|
|
|
};
|
|
|
|
|
2016-02-26 09:46:12 +00:00
|
|
|
private _rope = _nozzle getVariable [QGVAR(rope), objNull];
|
|
|
|
if !(isNull _rope) then {
|
2015-11-21 22:24:24 +00:00
|
|
|
ropeDestroy _rope;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(resetLocal), [_x, _nozzle], _x] call CBA_fnc_targetEvent;
|
2015-11-21 22:24:24 +00:00
|
|
|
} count allPlayers;
|
|
|
|
deleteVehicle _nozzle;
|
|
|
|
};
|
2015-11-23 18:28:51 +00:00
|
|
|
_target setVariable [QGVAR(ownedNozzle), nil, true];
|