Skip to content

Commit

Permalink
Merge branch 'master' into versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
DomT602 authored Sep 15, 2018
2 parents 75662f0 + 9de71f2 commit 7166800
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions Altis_Life.Altis/core/functions/fn_inventoryOpened.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,43 @@
Description:
For the mean time it blocks the player from opening another persons backpack
*/
private ["_container","_unit","_list"];
if (count _this isEqualTo 1) exitWith {false};
_unit = _this select 0;
_container = _this select 1;

_isPack = FETCH_CONFIG2(getNumber,"CfgVehicles",typeOf _container,"isBackpack");
if (_isPack isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true;
};

if ((typeOf _container) in ["Box_IND_Grenades_F","B_supplyCrate_F"]) exitWith {
_house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && (_house getVariable ["locked",true])) exitWith {
hint localize "STR_House_ContainerDeny";
true;
params [
["_unit", objNull, [objNull]],
["_container", objNull, [objNull]],
["_secContainer", objNull, [objNull]]
];

scopeName "main";
private _list = ["LandVehicle", "Ship", "Air"];

{
if (isNull _x) then {false breakOut "main"};

private _containerType = typeOf _x;

if (FETCH_CONFIG2(getNumber, "CfgVehicles", _containerType, "isBackpack") isEqualTo 1) exitWith {
hint localize "STR_MISC_Backpack";
true breakOut "main";
};
};

_list = ["LandVehicle","Ship","Air"];
if (KINDOF_ARRAY(_container,_list)) exitWith {
if (!(_container in life_vehicles) && {locked _container isEqualTo 2}) exitWith {
hint localize "STR_MISC_VehInventory";
true;
if (_containerType in ["Box_IND_Grenades_F", "B_supplyCrate_F"]) exitWith {
private _house = nearestObject [player, "House"];
if (!(_house in life_vehicles) && {_house getVariable ["locked",true]}) exitWith {
hint localize "STR_House_ContainerDeny";
true breakOut "main";
};
};
};

//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_container isKindOf "Man" && !alive _container) exitWith {
hint localize "STR_NOTF_NoLootingPerson";
true;
};
if (KINDOF_ARRAY(_x, _list)) exitWith {
if (!(_x in life_vehicles) && {locked _x isEqualTo 2}) exitWith {
hint localize "STR_MISC_VehInventory";
true breakOut "main";
};
};

//Allow alive players who've been knocked out to be looted, just not the dead ones
if (_x isKindOf "Man" && {!alive _x}) exitWith {
hint localize "STR_NOTF_NoLootingPerson";
true breakOut "main";
};
} count [_container, _secContainer];

0 comments on commit 7166800

Please sign in to comment.