mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fastroping - Fix FRIES not working after vehicle respawn (#10268)
This commit is contained in:
parent
884ae78704
commit
96700e8dfd
@ -40,6 +40,14 @@ if (isServer) then {
|
||||
}, true, ["ACE_friesBase"], true] call CBA_fnc_addClassEventHandler;
|
||||
};
|
||||
|
||||
// Handles the Vanilla respawn module
|
||||
[missionNamespace, "respawn", {
|
||||
params ["_vehicle"];
|
||||
|
||||
if !(_vehicle getVariable [QGVAR(addFRIESOnRespawn), false]) exitWith {};
|
||||
|
||||
_vehicle call FUNC(equipFRIES);
|
||||
}] call BIS_fnc_addScriptedEventHandler;
|
||||
|
||||
#ifdef DRAW_FASTROPE_INFO
|
||||
addMissionEventHandler ["Draw3D", {
|
||||
|
@ -19,7 +19,7 @@
|
||||
params ["_vehicle"];
|
||||
|
||||
if (!alive _vehicle) exitWith { WARNING_1("bad vehicle %1",_this); };
|
||||
if (alive (_vehicle getVariable [QGVAR(FRIES),objNull])) exitWith { WARNING_1("already equiped %1",_this); };
|
||||
if (alive (_vehicle getVariable [QGVAR(FRIES), objNull])) exitWith { WARNING_1("already equipped %1",_this); };
|
||||
|
||||
private _config = configOf _vehicle;
|
||||
if !(isNumber (_config >> QGVAR(enabled))) then {
|
||||
@ -29,6 +29,12 @@
|
||||
private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0];
|
||||
_fries attachTo [_vehicle, getArray (_config >> QGVAR(friesAttachmentPoint))];
|
||||
_vehicle setVariable [QGVAR(FRIES), _fries, true];
|
||||
|
||||
// The Vanilla respawn module copies all variables from old object to new one
|
||||
// Use that to move variable from wreck to new vehicle
|
||||
_vehicle setVariable [QGVAR(addFRIESOnRespawn), true, true];
|
||||
};
|
||||
};
|
||||
}, _this] call CBA_fnc_execNextFrame;
|
||||
|
||||
nil
|
||||
|
Loading…
Reference in New Issue
Block a user