Additional Check

This commit is contained in:
He-Man 2017-09-05 18:06:30 +02:00 committed by GitHub
parent 1684b20933
commit 3cb8db20ec

View File

@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_blocked","_containerlocked","_seclocked"];
private ["_stored","_savecontainer","_blocked","_containerlocked","_seclocked"];
//[[[end]]]
params ["_unit","_container","_sec"];
setMousePosition[0.5, 0.5];
@ -38,4 +38,31 @@ if (!_blocked && _containerlocked || _seclocked) then {
ctrlActivate _ground;
};
};
_savecontainer = objnull;
_vehSlot1 = _container getVariable["VEHICLE_SLOT", "ABORT"];
_storageSlot1 = _container getVariable["STORAGE_SLOT", "ABORT"];
_vehSlot2 = _sec getVariable["VEHICLE_SLOT", "ABORT"];
_storageSlot2 = _sec getVariable["STORAGE_SLOT", "ABORT"];
if (_vehSlot1 != "ABORT" || _storageSlot1 != "ABORT") then{
_savecontainer = _container;
}
else {
if (_vehSlot2 != "ABORT" || _storageSlot2 != "ABORT") then{
_savecontainer = _sec;
};
};
if (!isnull _savecontainer && !_blocked) then {
_savecontainer spawn {
waituntil {!isnull (findDisplay 602)};
while {!isnull (findDisplay 602)} do {
_stored = [itemcargo _this, magazinecargo _this, backpackcargo _this];
waituntil {uisleep 0.5; !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) || isnull (findDisplay 602)};
if !(_stored isequalto [itemcargo _this, magazinecargo _this, backpackcargo _this]) then {
_this call EPOCH_interact;
};
};
};
};
_blocked