From 8cc6068418bfdd86690fbaec020e272f0c4f3462 Mon Sep 17 00:00:00 2001 From: He-Man Date: Thu, 18 Apr 2019 18:36:39 +0200 Subject: [PATCH] Inventory from unconscious Units --- .../event_handlers/EPOCH_InventoryOpened.sqf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf index c0601f65..d3dc5545 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf @@ -13,9 +13,21 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_stored","_savecontainer","_blocked","_containerlocked","_seclocked"]; +private ["_InvTarget","_stored","_savecontainer","_blocked","_containerlocked","_seclocked"]; //[[[end]]] params ["_unit","_container","_sec"]; + +_InvTarget = ObjNull; +{ + if (_x isKindOf "MAN" && {player distance _x < 2} && {lifeState _x == "INCAPACITATED"} && {!(_x in [_container,_sec])}) exitwith { + _InvTarget = _x; + }; +} foreach [cursortarget,cursorobject]; +if (!isnull _InvTarget) exitwith { + player action ["Gear",_InvTarget]; + true +}; + setMousePosition[0.5, 0.5]; call EPOCH_showStats; _this spawn EPOCH_initUI;