Allow water actions from within vehicle

This commit is contained in:
mrschick 2024-08-10 15:29:53 +02:00
parent c452f94779
commit 831bf92ca1
3 changed files with 8 additions and 4 deletions

View File

@ -18,10 +18,9 @@
params ["_interactionType"];
// Ignore when self-interaction, mounted vehicle interaction, or water source actions are disabled
// Ignore during self-interaction or when water source actions are disabled
if (
_interactionType != 0
|| {vehicle ACE_player != ACE_player}
|| {XGVAR(waterSourceActions) == 0}
) exitWith {};
@ -56,8 +55,10 @@ TRACE_1("Starting interact PFH",_interactionType);
_sourcesHelped pushBack _vehicle;
// Add water source actions to the vehicle itself
private _mainAction = [_vehicle, 0, ["ACE_MainActions"], GVAR(mainAction)] call EFUNC(interact_menu,addActionToObject);
private _selfAction = [_vehicle, 1, ["ACE_SelfActions"], GVAR(mainAction)] call EFUNC(interact_menu,addActionToObject);
{
[_vehicle, 0, _mainAction, _x] call EFUNC(interact_menu,addActionToObject);
[_vehicle, 1, _selfAction, _x] call EFUNC(interact_menu,addActionToObject);
} forEach GVAR(subActions);
_vehicle setVariable [QGVAR(waterSourceActionsAdded), true];
TRACE_3("Added interaction to vehicle",_x,typeOf _x,_waterRemaining);

View File

@ -34,5 +34,7 @@ params ["_player", "_source"];
};
},
{},
LLSTRING(CheckingWater)
LLSTRING(CheckingWater),
{true},
["isNotInside"]
] call EFUNC(common,progressBar);

View File

@ -76,5 +76,6 @@ private _progressText = if (isNull _sourceConfig) then {
_fnc_onSuccess,
_fnc_onFailure,
_progressText,
_fnc_condition
_fnc_condition,
["isNotInside"]
] call EFUNC(common,progressBar);