mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fea2326488
- Add a ace_cargo_space attribute to vehicles to alter how much cargo they can carry. - Add an ace_cargo_size attribute to objects to alter how much cargo space they consume. - Add two public functions `fnc_setSize.sqf` and `fnc_setSpace.sqf` to update the cargo size/space respectively of any given object. - Deprecate cargo makeLoadable module and public function. - Added some macros to get the space/size of a config, making code more readable in places.
37 lines
911 B
Plaintext
37 lines
911 B
Plaintext
/*
|
|
* Author: PabstMirror
|
|
* Module to make an object loadable.
|
|
*
|
|
* Arguments:
|
|
* 0: The module logic <OBJECT>
|
|
* 1: Synchronized units <ARRAY>
|
|
* 2: Activated <BOOL>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [logic, [box], true] call ace_cargo_fnc_moduleMakeLoadable
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_logic", "_objects", "_activated"];
|
|
TRACE_3("params",_logic,_objects,_activated);
|
|
|
|
ACE_DEPRECATED(QFUNC(moduleMakeLoadable),"3.12.0","Eden editor object attributes");
|
|
|
|
if ((isNull _logic) || {!_activated}) exitWith {};
|
|
if (_objects isEqualTo []) exitWith {
|
|
WARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic);
|
|
};
|
|
|
|
private _canLoad = _logic getVariable ["canLoad", true];
|
|
private _setSize = _logic getVariable ["setSize", 1];
|
|
TRACE_2("settings",_canLoad,_setSize);
|
|
|
|
{
|
|
[_x, _canLoad, _setSize] call FUNC(makeLoadable);
|
|
} forEach _objects;
|