simplify dump backpack code

hopefully fix #1159
This commit is contained in:
[VB]AWOL
2014-04-23 18:03:17 -05:00
parent 6ef0acd135
commit 13babfec28
2 changed files with 9 additions and 16 deletions

Binary file not shown.

View File

@@ -1,20 +1,13 @@
private ["_weapons","_magazines","_weaponscnt","_magazinescnt","_backpack"];
_backpack = nearestObject [player, "Bag_Base_EP1"];
if (!(isNull _backpack) and local _backpack) then {
_weapons = getWeaponCargo _backpack;
_magazines = getMagazineCargo _backpack;
_weaponscnt = count (_weapons select 0);
_magazinescnt = count (_magazines select 0);
if((_magazinescnt > 0) or (_weaponscnt > 0)) then {
/* PVS/PVC - Skaronator */
_pos = getPosATL player;
_inRange = _pos nearEntities ["CAManBase",300];
{
// run only on other players
if(isPlayer _x and _x != player) then {
PVDZE_send = [_x,"HideObj",[_backpack]];
publicVariableServer "PVDZE_send";
};
} forEach _inRange;
if (!(isNull _backpack)) then{}
if (!local _backpack) then{
_weapons = getWeaponCargo _backpack;
_magazines = getMagazineCargo _backpack;
_weaponscnt = count(_weapons select 0);
_magazinescnt = count(_magazines select 0);
if ((_magazinescnt > 0) or(_weaponscnt > 0)) then{
hideObject _backpack;
};
};
};