mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
36 lines
816 B
Plaintext
36 lines
816 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Add (negative numbers to subtract) a virtual mass to a units container.
|
|
*
|
|
* Arguments:
|
|
* 0: The Unit <OBJECT>
|
|
* 1: The Container <OBJECT>
|
|
* 2: The Virtual Load <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* Success? <BOOLEAN>
|
|
*
|
|
* Example:
|
|
* [bob, box, 5] call ace_movement_fnc_addLoadToUnitContainer
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params [["_unit", objNull, [objNull]], ["_container", objNull, [objNull]], ["_virtualLoadToAdd", 0, [0]]];
|
|
|
|
if !(_container in [
|
|
_unit,
|
|
uniformContainer _unit,
|
|
vestContainer _unit,
|
|
backpackContainer _unit
|
|
]) exitWith {false};
|
|
|
|
private _virtualLoad = (_container getVariable [QGVAR(vLoad), 0]) + _virtualLoadToAdd;
|
|
_container setVariable [QGVAR(vLoad), _virtualLoad, true];
|
|
|
|
// update
|
|
_unit call FUNC(handleVirtualMass);
|
|
|
|
true
|