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
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
params [["_target", objNull, [objNull]]];
|
2015-11-21 22:24:24 +00:00
|
|
|
|
2015-11-23 18:28:51 +00:00
|
|
|
if (local _target) then {
|
2015-11-21 22:24:24 +00:00
|
|
|
_target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]];
|
2015-11-23 18:28:51 +00:00
|
|
|
} else {
|
|
|
|
[[_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]], "{(_this select 0) setHitPointDamage (_this select 1)}", _target] call EFUNC(common,execRemoteFnc);
|
2015-11-21 22:24:24 +00:00
|
|
|
};
|
|
|
|
_target setVariable [QGVAR(engineHit), nil, true];
|
|
|
|
_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-02 14:03:06 +00:00
|
|
|
private _rope = _nozzle getVariable [QGVAR(rope), nil];
|
2015-11-21 22:24:24 +00:00
|
|
|
if !(isNil "_rope") then {
|
|
|
|
ropeDestroy _rope;
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2015-11-23 18:28:51 +00:00
|
|
|
if (local _x) then {
|
|
|
|
[_x, _nozzle] call FUNC(resetLocal);
|
|
|
|
} else {
|
|
|
|
[[_x, _nozzle], "{_this call FUNC(resetLocal)}", _x] call EFUNC(common,execRemoteFnc);
|
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];
|