Bypassed interaction menu subactions distance bug

This commit is contained in:
jonpas 2015-08-17 01:44:47 +02:00
parent 68370f63d7
commit 4dc8747430
8 changed files with 17 additions and 25 deletions

View File

@ -1,5 +1,3 @@
#define REFUEL_ACTION_DISTANCE 4.5
#define MACRO_REFUEL_ACTIONS \
class ACE_Actions: ACE_Actions { \
class ACE_MainActions: ACE_MainActions { \
@ -20,7 +18,7 @@
}; \
class GVAR(Return) { \
displayName = CSTRING(Return); \
condition = QUOTE([ARR_1(_player)] call FUNC(canConnectNozzle)); \
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canConnectNozzle)); \
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(returnNozzle)); \
exceptions[] = {"isNotInside"}; \
icon = PATHTOF(ui\icon_refuel_interact.paa); \
@ -64,7 +62,7 @@
class GVAR(TurnOff) { \
displayName = CSTRING(TurnOff); \
condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTurnOff)); \
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(turnOff)); \
statement = QUOTE([_target] call DFUNC(turnOff)); \
exceptions[] = {"isNotInside"}; \
icon = PATHTOF(ui\icon_refuel_interact.paa); \
}; \

View File

@ -17,9 +17,9 @@
#include "script_component.hpp"
private ["_nozzle"];
params ["_unit"];
params ["_unit", "_target"];
_nozzle = _unit getVariable QGVAR(nozzle);
if (isNil "_nozzle") exitWith {false};
if (isNil "_nozzle" || {(_target distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false};
true
true

View File

@ -30,4 +30,4 @@ if (isNull _sink) exitWith {false};
_fueling = _nozzle getVariable [QGVAR(fueling), 0];
if (_fueling == 1) exitWith {false};
true
true

View File

@ -17,9 +17,9 @@
private ["_fuel"];
params ["_unit", "_target"];
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || { (_target distance _unit) > 7}) exitWith {false};
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {(_target distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false};
_fuel = [_unit, _target] call FUNC(getFuel);
if (_fuel > 0 || {_fuel == -1}) exitWith {true};
false
false

View File

@ -16,7 +16,6 @@
*/
#include "script_component.hpp"
private ["_nozzle", "_fueling"];
params ["_unit", "_nozzleHolder"];
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {(_nozzleHolder distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false};

View File

@ -1,26 +1,20 @@
/*
* Author: GitHawk
* Check if a unit can turn off a fuel nozzle
* Turn off a fuel nozzle
*
* Arguments:
* 0: The unit <OBJECT>
* 1: The object holding the nozzle <OBJECT>
* 0: The object holding the nozzle <OBJECT>
*
* Return Value:
* Can turn off <BOOL>
* None
*
* Example:
* [player, nozzle] call ace_refuel_fnc_canTurnOff
* [player, nozzle] call ace_refuel_fnc_turnOff
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_nozzleHolder"];
params ["_nozzleHolder"];
if (isNull _unit || {!(_unit isKindOf "CAManBase")} || {!local _unit} || { (_nozzleHolder distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false};
_nozzle = _nozzleHolder getVariable QGVAR(nozzle);
_nozzle setVariable [QGVAR(fueling), 0];
true
(_nozzleHolder getVariable QGVAR(nozzle)) setVariable [QGVAR(fueling), 0];

View File

@ -1,3 +1 @@
#include "\z\ace\addons\refuel\script_component.hpp"
#define REFUEL_ACTION_DISTANCE 4.5

View File

@ -10,3 +10,6 @@
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define REFUEL_ACTION_DISTANCE 4.5