2016-05-03 16:12:47 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Add (negative numbers to subtract) a virtual mass to a units container.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
2016-05-03 16:16:39 +00:00
|
|
|
* 1: The Container <OBJECT>
|
2016-05-03 16:12:47 +00:00
|
|
|
* 2: The Virtual Load <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Success? <BOOLEAN>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob, box, 5] call ace_movement_fnc_addLoadToUnitContainer
|
|
|
|
*
|
2016-05-03 16:12:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params [["_unit", objNull, [objNull]], ["_container", objNull, [objNull]], ["_virtualLoadToAdd", 0, [0]]];
|
|
|
|
|
|
|
|
if !(_container in [
|
2016-05-10 20:32:40 +00:00
|
|
|
_unit,
|
2016-05-03 16:12:47 +00:00
|
|
|
uniformContainer _unit,
|
|
|
|
vestContainer _unit,
|
|
|
|
backpackContainer _unit
|
|
|
|
]) exitWith {false};
|
|
|
|
|
|
|
|
private _virtualLoad = (_container getVariable [QGVAR(vLoad), 0]) + _virtualLoadToAdd;
|
2016-05-03 16:16:39 +00:00
|
|
|
_container setVariable [QGVAR(vLoad), _virtualLoad, true];
|
2016-05-03 16:12:47 +00:00
|
|
|
|
|
|
|
// update
|
|
|
|
_unit call FUNC(handleVirtualMass);
|
|
|
|
|
|
|
|
true
|