Merge pull request #856 from Ignatz-HeMan/patch-3

Additional Check
This commit is contained in:
vbawol 2017-09-05 15:25:54 -05:00 committed by GitHub
commit 6e378ee221

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