mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Execute take nozzle actions only on progress bar success (#3783)
* Execute take nozzle actions only on progress bar success - fix #3739, Prettify params * Fix animation on holster
This commit is contained in:
parent
09371bce96
commit
5147f366a5
@ -18,17 +18,16 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
|
||||
|
||||
[_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set);
|
||||
params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_target", objNull, [objNull]],
|
||||
["_nozzle", objNull, [objNull]]
|
||||
];
|
||||
|
||||
REFUEL_HOLSTER_WEAPON
|
||||
|
||||
private _endPosOffset = [0, 0, 0];
|
||||
if (isNull _nozzle) then { // func is called on fuel truck
|
||||
[_target, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set);
|
||||
|
||||
_target setVariable [QGVAR(isConnected), true, true];
|
||||
_endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
||||
if (count _endPosOffset == 2) then {
|
||||
if (_unit distance (_target modelToWorld (_endPosOffset select 0)) < _unit distance (_target modelToWorld (_endPosOffset select 1))) then {
|
||||
@ -44,7 +43,11 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
||||
[_unit, _target, _endPosOffset],
|
||||
{
|
||||
params ["_args"];
|
||||
_args params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]], ["_endPosOffset", [0,0,0], [[]], 3]];
|
||||
_args params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_target", objNull, [objNull]],
|
||||
["_endPosOffset", [0, 0, 0], [[]], 3]
|
||||
];
|
||||
|
||||
private _newNozzle = "ACE_refuel_fuelNozzle" createVehicle position _unit;
|
||||
_newNozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"];
|
||||
@ -57,8 +60,12 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
||||
};
|
||||
_newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true];
|
||||
_newNozzle setVariable [QGVAR(source), _target, true];
|
||||
|
||||
[_target, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set);
|
||||
_target setVariable [QGVAR(isConnected), true, true];
|
||||
_target setVariable [QGVAR(ownedNozzle), _newNozzle, true];
|
||||
|
||||
[_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set);
|
||||
_unit setVariable [QGVAR(isRefueling), true];
|
||||
private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
||||
if (_actionID != -1) then {
|
||||
@ -87,7 +94,11 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
||||
[_unit, _nozzle],
|
||||
{
|
||||
params ["_args"];
|
||||
_args params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
|
||||
_args params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_nozzle", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if (_nozzle getVariable [QGVAR(jerryCan), false]) then {
|
||||
_nozzle attachTo [_unit, [0,1,0], "pelvis"];
|
||||
} else {
|
||||
@ -95,6 +106,7 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
||||
};
|
||||
_unit setVariable [QGVAR(nozzle), _nozzle, true];
|
||||
|
||||
[_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set);
|
||||
_unit setVariable [QGVAR(isRefueling), true];
|
||||
private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
||||
if (_actionID != -1) then {
|
||||
@ -124,8 +136,13 @@ if (isNull _nozzle) then { // func is called on fuel truck
|
||||
if !(_nozzle getVariable [QGVAR(jerryCan), false]) then {
|
||||
[{
|
||||
params ["_args", "_pfID"];
|
||||
_args params [["_unit", player, [objNull]], ["_source", objNull, [objNull]], ["_endPosOffset", [0, 0, 0], [[]], 3]];
|
||||
_args params ["", "", "", ["_nozzle", _unit getVariable [QGVAR(nozzle), objNull], [objNull]]];
|
||||
_args params [
|
||||
["_unit", player, [objNull]],
|
||||
["_source", objNull, [objNull]],
|
||||
["_endPosOffset", [0, 0, 0], [[]], 3],
|
||||
["_nozzle", _unit getVariable [QGVAR(nozzle), objNull], [objNull]]
|
||||
];
|
||||
|
||||
if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith {
|
||||
if !(isNull _nozzle) then {
|
||||
[_unit, _nozzle] call FUNC(dropNozzle);
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#define REFUEL_HOLSTER_WEAPON \
|
||||
_unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; \
|
||||
_unit call EFUNC(common,fixLoweredRifleAnimation); \
|
||||
_unit action ["SwitchWeapon", _unit, _unit, 99];
|
||||
|
||||
#define REFUEL_UNHOLSTER_WEAPON \
|
||||
|
Loading…
Reference in New Issue
Block a user