2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-12 09:07:03 +00:00
|
|
|
/*
|
2015-10-03 23:26:38 +00:00
|
|
|
* Author: bux578, commy2
|
2015-09-26 14:26:41 +00:00
|
|
|
* Restores previously saved gear.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
2024-07-20 06:13:42 +00:00
|
|
|
* 1: All Gear based on return value of ace_common_fnc_getAllGear <ARRAY>
|
|
|
|
* 2: All weapon info needed for restoring previous weapon status <ARRAY>
|
2015-09-26 14:26:41 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-10-03 23:26:38 +00:00
|
|
|
* [ACE_Player, stored_allGear, active_weapon_muzzle_and_mode] call ace_respawn_fnc_restoreGear
|
2015-09-26 14:26:41 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-12 10:24:58 +00:00
|
|
|
|
2015-10-03 23:26:38 +00:00
|
|
|
params ["_unit", "_allGear", "_activeWeaponAndMuzzle"];
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_3("restoreGear",_unit,count _allGear,_activeWeaponAndMuzzle);
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2024-07-20 06:13:42 +00:00
|
|
|
// Restore all gear
|
2016-05-14 08:49:09 +00:00
|
|
|
if (!isNil "_allGear") then {
|
2022-08-25 16:56:54 +00:00
|
|
|
[_unit, _allGear] call CBA_fnc_setLoadout;
|
2016-05-14 08:49:09 +00:00
|
|
|
};
|
2015-08-15 16:54:39 +00:00
|
|
|
|
2024-07-20 06:13:42 +00:00
|
|
|
// Restore the last active weapon, muzzle and weapon mode
|
2016-05-14 08:49:09 +00:00
|
|
|
if (!isNil "_activeWeaponAndMuzzle") then {
|
2024-07-20 06:13:42 +00:00
|
|
|
_unit selectWeapon _activeWeaponAndMuzzle;
|
2015-01-12 09:07:03 +00:00
|
|
|
};
|