@@ -19,13 +19,14 @@ Example:
1919
2020params [" _item" , " _player" ]; // standard addAction
2121
22- // Redo the checks, because this function might be delayed by script load
23- if ((! isNull attachedTo _item ) or (call A3A_fnc_isCarrying ) or (! isNull objectParent _player )) exitWith {};
24- if (_item isKindOf " StaticWeapon" and count crew _item ! = 0 ) exitWith {};
25-
2622// Go unscheduled to keep the state consistent
2723isNil {
24+ // Redo the checks, because this function might be delayed by script load
25+ if ((! isNull attachedTo _item ) or (call A3A_fnc_isCarrying ) or (! isNull objectParent _player )) exitWith {};
26+ if (_item isKindOf " StaticWeapon" and count crew _item ! = 0 ) exitWith {};
27+
2828 if (_item isKindOf " StaticWeapon" ) then { _item lock true };
29+ _item lockInventory true ;
2930
3031 // Prevent killing players with item
3132 if (isNil {_item getVariable " A3A_originalMass" }) then { _item setVariable [" A3A_originalMass" , getMass _item ] };
@@ -49,9 +50,24 @@ isNil {
4950
5051 private _dropID = _player addAction [
5152 localize " STR_A3A_fn_UtilItem_dropOb_addact_drop" ,
52- { (_this #1 ) call A3A_fnc_dropItem }, _item , 4 , true , true , " " , " true"
53+ { (_this #1 ) call A3A_fnc_dropItem }, _item , 5 , true , true , " " , " true"
5354 ];
54- _player setVariable [" A3A_actionIDdrop" , _dropID ];
55+ private _actionIDs = [_dropID ];
56+
57+ // Add loot actions if it's a loot crate
58+ private _isUtility = typeOf _item in A3A_utilityItemHM;
59+ if (_isUtility and {" loot" in (A3A_utilityItemHM get typeOf _item ) # 4 }) then
60+ {
61+ _actionIDs pushBack (_player addAction [
62+ localize " STR_A3A_fn_ltc_init_addact_ltc" ,
63+ { [_this #3 , clientOwner] remoteExecCall [" A3A_fnc_canLoot" , 2 ] }, _item , 4 , true , true , " " , " true"
64+ ]);
65+ _actionIDs pushBack (_player addAction [
66+ localize " STR_A3A_fn_ltc_init_addact_ltv" ,
67+ { [_this #3 , clientOwner] remoteExecCall [" A3A_fnc_canTransfer" , 2 ] }, _item , 3 , true , true , " " , " true"
68+ ]);
69+ };
70+ _player setVariable [" A3A_carryActionIDs" , _actionIDs ];
5571
5672 [_player , _item ] spawn {
5773 params [" _player" , " _item" ];
0 commit comments