2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-18 21:41:25 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Adds spare parts to a vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The module logic <OBJECT>
|
|
|
|
* 1: Synchronized units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-09-26 04:36:35 +00:00
|
|
|
* [logic] call ace_repair_fnc_moduleAddSpareParts
|
2015-08-18 21:41:25 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_logic"];
|
|
|
|
|
|
|
|
if (!isNull _logic) then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _list = _logic getVariable ["List", ""];
|
|
|
|
private _part = _logic getVariable ["Part", 0];
|
|
|
|
private _amount = _logic getVariable ["Amount", 1];
|
2015-08-18 21:41:25 +00:00
|
|
|
|
|
|
|
// Parse list
|
2015-09-05 18:51:48 +00:00
|
|
|
_list = [_list, true, true] call EFUNC(common,parseList);
|
2015-08-18 21:41:25 +00:00
|
|
|
|
|
|
|
// Add synchronized objects to list
|
|
|
|
{
|
|
|
|
_list pushBack _x;
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach (synchronizedObjects _logic);
|
2015-08-18 21:41:25 +00:00
|
|
|
|
|
|
|
if (_list isEqualTo []) exitWith {};
|
|
|
|
|
2015-09-05 18:51:48 +00:00
|
|
|
TRACE_3("Module info parsed",_list,_part,_amount);
|
|
|
|
|
2015-08-18 21:41:25 +00:00
|
|
|
// Add spare parts
|
|
|
|
{
|
2015-09-05 18:51:48 +00:00
|
|
|
[_x, _amount, _part, true] call FUNC(addSpareParts);
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach _list;
|
2015-08-18 21:41:25 +00:00
|
|
|
};
|