From 3d6a5582683515e000193a8fbfdfd2bdb23f0c40 Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Sun, 14 Jun 2020 15:30:28 -0400 Subject: [PATCH] Fastroping - Fix FRIES removal (#7756) --- AUTHORS.txt | 4 ++-- addons/fastroping/XEH_preInit.sqf | 6 ++++++ addons/fastroping/functions/fnc_equipFRIES.sqf | 8 +++----- addons/fastroping/functions/fnc_unequipFRIES.sqf | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 631afc8668..0c8267b448 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -18,6 +18,7 @@ Janus jokoho482 Jonpas Kieran +mharis001 NouberNou PabstMirror Ruthberg @@ -114,7 +115,6 @@ Luigi "Luigium" Myrini Macusercom MarcBook meat -mharis001 Michail Nikolaev MikeMatrix nic547 @@ -160,4 +160,4 @@ Winter xrufix Zakant zGuba -Fyuran \ No newline at end of file +Fyuran diff --git a/addons/fastroping/XEH_preInit.sqf b/addons/fastroping/XEH_preInit.sqf index 9361d05015..6d6065b323 100644 --- a/addons/fastroping/XEH_preInit.sqf +++ b/addons/fastroping/XEH_preInit.sqf @@ -8,4 +8,10 @@ PREP_RECOMPILE_END; #include "initSettings.sqf" +if (isServer) then { + ["Helicopter", "Deleted", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; +}; + +["Helicopter", "Killed", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; + ADDON = true; diff --git a/addons/fastroping/functions/fnc_equipFRIES.sqf b/addons/fastroping/functions/fnc_equipFRIES.sqf index 7b1002db20..002a32364c 100644 --- a/addons/fastroping/functions/fnc_equipFRIES.sqf +++ b/addons/fastroping/functions/fnc_equipFRIES.sqf @@ -14,18 +14,16 @@ * * Public: Yes */ + params ["_vehicle"]; private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; if !(isNumber (_config >> QGVAR(enabled))) then { - ["%1 has not been configured for ACE_Fastroping.", getText (_config >> "DisplayName")] call BIS_fnc_error; + ["%1 has not been configured for ACE_Fastroping.", getText (_config >> "displayName")] call BIS_fnc_error; } else { if (getNumber (_config >> QGVAR(enabled)) == 2) then { private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0]; - _fries attachTo [_vehicle, (getArray (_config >> QGVAR(friesAttachmentPoint)))]; + _fries attachTo [_vehicle, getArray (_config >> QGVAR(friesAttachmentPoint))]; _vehicle setVariable [QGVAR(FRIES), _fries, true]; - - _vehicle addEventHandler ["Killed", FUNC(unequipFRIES)]; - _vehicle addEventHandler ["Deleted", FUNC(unequipFRIES)]; }; }; diff --git a/addons/fastroping/functions/fnc_unequipFRIES.sqf b/addons/fastroping/functions/fnc_unequipFRIES.sqf index e89cacec9e..7fade927b6 100644 --- a/addons/fastroping/functions/fnc_unequipFRIES.sqf +++ b/addons/fastroping/functions/fnc_unequipFRIES.sqf @@ -14,11 +14,12 @@ * * Public: Yes */ + params ["_vehicle"]; deleteVehicle (_vehicle getVariable [QGVAR(FRIES), objNull]); _vehicle setVariable [QGVAR(FRIES), nil, true]; -if !((_vehicle getVariable [QGVAR(deployedRopes), []] isEqualTo [])) then { +if !(_vehicle getVariable [QGVAR(deployedRopes), []] isEqualTo []) then { [_vehicle] call FUNC(cutRopes); };