Skip to content

Commit

Permalink
Optimize fnc_takeNozzle
Browse files Browse the repository at this point in the history
  • Loading branch information
Dystopian committed Sep 9, 2017
1 parent a037955 commit 29ee376
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion addons/refuel/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class GVAR(PickUpNozzle) { \
displayName = CSTRING(TakeNozzle); \
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeNozzle)); \
statement = QUOTE([ARR_3(_player,objNull,_target)] call FUNC(takeNozzle)); \
statement = QUOTE([ARR_3(_player,_target)] call FUNC(takeNozzle)); \
exceptions[] = {"isNotInside", "isNotOnLadder"}; \
icon = QPATHTOF(ui\icon_refuel_interact.paa); \
}; \
Expand Down
2 changes: 1 addition & 1 deletion addons/refuel/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GVAR(actions) = [
[QGVAR(TakeNozzle),
localize LSTRING(TakeNozzle),
QPATHTOF(ui\icon_refuel_interact.paa),
{[_player, _target, objNull] call FUNC(TakeNozzle)},
{[_player, _target] call FUNC(TakeNozzle)},
{[_player, _target] call FUNC(canTakeNozzle)},
{}, [], [0,0,0],
REFUEL_ACTION_DISTANCE
Expand Down
2 changes: 1 addition & 1 deletion addons/refuel/functions/fnc_disconnect.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ _nozzle setVariable [QGVAR(sink), nil, true];
_nozzle setVariable [QGVAR(isConnected), false, true];
[objNull, _nozzle, true] call FUNC(dropNozzle);

[_unit, objNull, _nozzle] call FUNC(takeNozzle);
[_unit, _nozzle] call FUNC(takeNozzle);
2 changes: 1 addition & 1 deletion addons/refuel/functions/fnc_makeJerryCan.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private _action = [QGVAR(Refuel),
_action = [QGVAR(PickUpNozzle),
localize LSTRING(TakeNozzle),
QPATHTOF(ui\icon_refuel_interact.paa),
{[_player, objNull, _target] call FUNC(TakeNozzle)},
{[_player, _target] call FUNC(TakeNozzle)},
{[_player, _target] call FUNC(canTakeNozzle)},
{},
[],
Expand Down
11 changes: 4 additions & 7 deletions addons/refuel/functions/fnc_takeNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,26 @@
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Fuel Source <OBJECT>
* 2: Nozzle <OBJECT> (optional)
* 1: Fuel Source or Nozzle <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, fuelTruck] call ace_refuel_fnc_takeNozzle
* [player, objNull, nozzle] call ace_refuel_fnc_takeNozzle
* [player, cursorObject] call ace_refuel_fnc_takeNozzle
*
* Public: No
*/
#include "script_component.hpp"

params [
["_unit", objNull, [objNull]],
["_source", objNull, [objNull]],
["_nozzle", objNull, [objNull]]
["_object", objNull, [objNull]]
];

[
TIME_PROGRESSBAR(REFUEL_PROGRESS_DURATION),
[_unit, [_source, _nozzle] select isNull _source],
[_unit, _object],
{
params ["_args"];
_args params ["_unit", "_object"];
Expand Down

0 comments on commit 29ee376

Please sign in to comment.