mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
add container property
This commit is contained in:
parent
c46dc339c5
commit
6c2a8a2117
@ -56,8 +56,7 @@ if ((maxLoad _container) isEqualTo 0) then {
|
||||
|
||||
if (isNull _container) then {
|
||||
// Create ammo storage container
|
||||
private _weaponRelPos = _unloadTo getRelPos RELATIVE_DIRECTION(270);
|
||||
_weaponRelPos set [2, ((getPosATL _unloadTo) select 2) + 0.05];
|
||||
private _weaponRelPos = (_unloadTo getRelPos RELATIVE_DIRECTION(270)) vectorAdd [0, 0, 0.05];
|
||||
_container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "CAN_COLLIDE"];
|
||||
_unloadTo setVariable [QGVAR(container), _container, true];
|
||||
_container setDir random [0, 180, 360];
|
||||
|
@ -80,7 +80,30 @@ if (_vehicle getVariable [QGVAR(secondaryWeaponMagazine), ""] isNotEqualTo "") t
|
||||
|
||||
if (_storeExtraMagazines) then {
|
||||
TRACE_1("saving extra mags to container",_containerMagazineCount);
|
||||
|
||||
// Create container from config if available, use setting if not
|
||||
private _containerType = getText (configOf _vehicle >> QUOTE(ADDON) >> "container");
|
||||
if (_containerType isNotEqualTo "") then {
|
||||
private _relPos = (_vehicle getRelPos RELATIVE_DIRECTION(270)) vectorAdd [0, 0, 0.05];
|
||||
_container = createVehicle [_containerType, [0, 0, 0], [], 0, "CAN_COLLIDE"];
|
||||
_vehicle setVariable [QGVAR(container), _container, true];
|
||||
_container setDir random [0, 180, 360];
|
||||
_container setPosATL _relPos;
|
||||
if ((_relPos select 2) < 0.5) then {
|
||||
_container setVectorUp (surfaceNormal _relPos);
|
||||
};
|
||||
|
||||
// empty container inventory
|
||||
// TODO: make a function in common?
|
||||
clearItemCargoGlobal _container;
|
||||
clearWeaponCargoGlobal _container;
|
||||
clearMagazineCargoGlobal _container;
|
||||
clearBackpackCargoGlobal _container;
|
||||
} else {
|
||||
_container = _vehicle;
|
||||
};
|
||||
|
||||
{
|
||||
[_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo);
|
||||
[_container, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo);
|
||||
} forEach _containerMagazineClassnames;
|
||||
};
|
||||
|
@ -29,6 +29,7 @@ class CfgVehicles {
|
||||
class ace_csw {
|
||||
proxyWeapon = QFUNC(csw_getProxyWeapon);
|
||||
magazineLocation = "_target selectionPosition 'usti hlavne'";
|
||||
container = "ACE_Box_82mm_Mo_Combo";
|
||||
};
|
||||
class Turrets: Turrets {
|
||||
class MainTurret: MainTurret {
|
||||
|
@ -144,6 +144,8 @@ class CfgVehicles {
|
||||
desiredAmmo = 100; // When the weapon is reloaded it will try and reload to this ammo capacity
|
||||
// Optional callback function for when the CSW gets disassembled, called with [tripod, staticWeapon]
|
||||
disassembleFunc = "prefix_fnc_handleDisassembly";
|
||||
// Optional object to store unloaded magazines in
|
||||
container = "ReammoBox_F";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user