Fastroping - Fix FRIES removal (#7756)

This commit is contained in:
mharis001 2020-06-14 15:30:28 -04:00 committed by GitHub
parent c35f4f6fe2
commit 3d6a558268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 8 deletions

View File

@ -18,6 +18,7 @@ Janus
jokoho482 <jokoho482@gmail.com>
Jonpas <jonpas33@gmail.com>
Kieran
mharis001 <mhariszakar@gmail.com>
NouberNou
PabstMirror <pabstmirror@gmail.com>
Ruthberg <ulteq@web.de>
@ -114,7 +115,6 @@ Luigi "Luigium" Myrini <luigium@outlook.fr>
Macusercom <macusercom@gmail.com>
MarcBook
meat <p.humberdroz@gmail.com>
mharis001 <mhariszakar@gmail.com>
Michail Nikolaev
MikeMatrix <m.braun92@gmail.com>
nic547 <nic547@outlook.com>
@ -160,4 +160,4 @@ Winter <simon@agius-muscat.net>
xrufix
Zakant <Zakant@gmx.de>
zGuba
Fyuran <dankemedic@hotmail.com>
Fyuran <dankemedic@hotmail.com>

View File

@ -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;

View File

@ -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)];
};
};

View File

@ -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);
};