forked from Giallustio/HeartsAndMinds
-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from Vdauphin/Add-ACE_cargo
Add: ACE cargo
- Loading branch information
Showing
27 changed files
with
625 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 50 additions & 46 deletions
96
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/db/loadcargo.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,67 @@ | ||
params ["_obj", "_cargo", "_inventory"]; | ||
[{ | ||
params ["_obj", "_cargo", "_inventory"]; | ||
|
||
//handle cargo | ||
{ | ||
_x params ["_type", "_magClass", "_cargo_obj"]; | ||
//handle cargo | ||
{ | ||
_x params ["_type", "_magClass", "_cargo_obj"]; | ||
|
||
private _l = _type createVehicle [0, 0, 0]; | ||
if (_magClass != "") then { | ||
_l setVariable ["ace_rearm_magazineClass", _magClass, true] | ||
}; | ||
btc_log_obj_created pushBack _l; | ||
btc_curator addCuratorEditableObjects [[_l], false]; | ||
private _l = createVehicle [_type, getPosATL _obj, [], 0, "CAN_COLLIDE"]; | ||
[_l] call btc_fnc_log_init; | ||
private _isloaded = [_l, _obj] call ace_cargo_fnc_loadItem; | ||
if (btc_debug_log) then { | ||
[format ["Object loaded: %1 in veh/container %2 IsLoaded: %3", _l, _obj, _isloaded], __FILE__, [false]] call btc_fnc_debug_message; | ||
}; | ||
|
||
clearWeaponCargoGlobal _l; | ||
clearItemCargoGlobal _l; | ||
clearMagazineCargoGlobal _l; | ||
if (_magClass != "") then { | ||
_l setVariable ["ace_rearm_magazineClass", _magClass, true] | ||
}; | ||
|
||
_cargo_obj params ["_weap_obj", "_mags_obj", "_items_obj"]; | ||
clearWeaponCargoGlobal _l; | ||
clearItemCargoGlobal _l; | ||
clearMagazineCargoGlobal _l; | ||
|
||
if !(_weap_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_weap_obj select 0)) - 1) do { | ||
_l addWeaponCargoGlobal [(_weap_obj select 0) select _i, (_weap_obj select 1) select _i]; | ||
_cargo_obj params ["_weap_obj", "_mags_obj", "_items_obj"]; | ||
|
||
if !(_weap_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_weap_obj select 0)) - 1) do { | ||
_l addWeaponCargoGlobal [(_weap_obj select 0) select _i, (_weap_obj select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
|
||
if !(_mags_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_mags_obj select 0)) - 1) do { | ||
_l addMagazineCargoGlobal [(_mags_obj select 0) select _i, (_mags_obj select 1) select _i]; | ||
if !(_mags_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_mags_obj select 0)) - 1) do { | ||
_l addMagazineCargoGlobal [(_mags_obj select 0) select _i, (_mags_obj select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
|
||
if !(_items_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_items_obj select 0)) - 1) do { | ||
_l addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; | ||
if !(_items_obj isEqualTo []) then { | ||
for "_i" from 0 to ((count (_items_obj select 0)) - 1) do { | ||
_l addItemCargoGlobal [(_items_obj select 0) select _i, (_items_obj select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
[_l, _obj] call btc_fnc_log_server_load; | ||
} forEach _cargo; | ||
} forEach _cargo; | ||
|
||
//set inventory content for weapons, magazines and items | ||
_inventory params ["_weap", "_mags", "_items"]; | ||
//set inventory content for weapons, magazines and items | ||
_inventory params ["_weap", "_mags", "_items"]; | ||
|
||
clearWeaponCargoGlobal _obj; | ||
clearItemCargoGlobal _obj; | ||
clearMagazineCargoGlobal _obj; | ||
clearWeaponCargoGlobal _obj; | ||
clearItemCargoGlobal _obj; | ||
clearMagazineCargoGlobal _obj; | ||
|
||
if !(_weap isEqualTo []) then { | ||
for "_i" from 0 to ((count (_weap select 0)) - 1) do { | ||
_obj addWeaponCargoGlobal [(_weap select 0) select _i, (_weap select 1) select _i]; | ||
if !(_weap isEqualTo []) then { | ||
for "_i" from 0 to ((count (_weap select 0)) - 1) do { | ||
_obj addWeaponCargoGlobal [(_weap select 0) select _i, (_weap select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
if !(_mags isEqualTo []) then { | ||
for "_i" from 0 to ((count (_mags select 0)) - 1) do { | ||
_obj addMagazineCargoGlobal [(_mags select 0) select _i, (_mags select 1) select _i]; | ||
if !(_mags isEqualTo []) then { | ||
for "_i" from 0 to ((count (_mags select 0)) - 1) do { | ||
_obj addMagazineCargoGlobal [(_mags select 0) select _i, (_mags select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
if !(_items isEqualTo []) then { | ||
for "_i" from 0 to ((count (_items select 0)) - 1) do { | ||
_obj addItemCargoGlobal [(_items select 0) select _i, (_items select 1) select _i]; | ||
if !(_items isEqualTo []) then { | ||
for "_i" from 0 to ((count (_items select 0)) - 1) do { | ||
_obj addItemCargoGlobal [(_items select 0) select _i, (_items select 1) select _i]; | ||
}; | ||
}; | ||
}; | ||
|
||
_obj | ||
}, _this] call CBA_fnc_waitAndExecute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
=BTC=co@30_Hearts_and_Minds.Altis/core/fnc/log/CuratorObjectPlaced_s.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.