mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
3edeff217a
* work on arsenal actions * cycle through pages * docs * cleanup * Update addons/gunbag/functions/fnc_weaponName.sqf Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * missing fil * Update addons/arsenal/functions/fnc_itemInfo.sqf * Update addons/arsenal/functions/fnc_refresh.sqf Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> * remove CBA_loadoutSet gunbag cache * update fnc_refresh * fix 3den --------- Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com> Co-authored-by: Salluci <salluci.lovi@gmail.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
ADDON = false;
|
|
|
|
PREP_RECOMPILE_START;
|
|
#include "XEH_PREP.hpp"
|
|
PREP_RECOMPILE_END;
|
|
|
|
#include "initSettings.sqf"
|
|
|
|
// restore gunbag info after respawn
|
|
["CAManBase", "respawn", {
|
|
[{
|
|
params ["_unit", "_corpse"];
|
|
|
|
private _newBackpack = backpackContainer _unit;
|
|
private _oldBackpack = backpackContainer _corpse;
|
|
|
|
if (typeOf _newBackpack isNotEqualTo typeOf _oldBackpack) exitWith {};
|
|
|
|
private _state = _oldBackpack getVariable [QGVAR(gunbagWeapon), []];
|
|
|
|
if (_state isNotEqualTo []) then {
|
|
_newBackpack setVariable [QGVAR(gunbagWeapon), _state, true];
|
|
};
|
|
}, _this] call CBA_fnc_execNextFrame;
|
|
}] call CBA_fnc_addClassEventHandler;
|
|
|
|
["CBA_loadoutSet", {
|
|
params ["_unit", "_loadout", "_extendedInfo"];
|
|
private _gunbagWeapon = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []];
|
|
if (_gunbagWeapon isNotEqualTo []) then {
|
|
(backpackContainer _unit) setVariable [QGVAR(gunbagWeapon), _gunbagWeapon, true];
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
["CBA_loadoutGet", {
|
|
params ["_unit", "_loadout", "_extendedInfo"];
|
|
private _gunbagWeapon = (backpackContainer _unit) getVariable [QGVAR(gunbagWeapon), []];
|
|
if (_gunbagWeapon isNotEqualTo []) then {
|
|
_extendedInfo set [QGVAR(gunbagWeapon), _gunbagWeapon];
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
ADDON = true;
|