Merge pull request #2170 from jokoho48/codeCleanupLogisticUAVBattery

Code Cleanup Logistic UAV Battery
This commit is contained in:
Glowbal 2015-08-16 08:49:07 +02:00
commit 206ee6e471
2 changed files with 8 additions and 10 deletions

View File

@ -16,6 +16,6 @@
*/
#include "script_component.hpp"
PARAMS_2(_caller,_target);
params ["_caller", "_target"];
("ACE_UAVBattery" in (items _caller)) && {(fuel _target) < 1} && {(speed _target) < 1} && {!(isEngineOn _target)} && {(_target distance _caller) <= 4}

View File

@ -15,23 +15,21 @@
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_caller,_target);
private ["_onFinish", "_onFailure"];
params ["_caller", "_target"];
if (!(_this call FUNC(canRefuelUAV))) exitWith {};
_onFinish = {
EXPLODE_2_PVT((_this select 0),_caller,_target);
_caller removeItem "ACE_UAVBattery";
playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10];
["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local
(_this select 0) params ["_caller", "_target"];
_caller removeItem "ACE_UAVBattery";
playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10];
["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local
};
_onFailure = {
EXPLODE_2_PVT((_this select 0),_caller,_target);
[_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
(_this select 0) params ["_caller", "_target"];
[_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
};
[_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);