Add a few missing playerIsNear checks

Blocks duping method reported by Sercan and confirmed with @oiad .
Thanks
This commit is contained in:
ebayShopper
2017-02-25 17:29:27 -05:00
parent a3f2b8db57
commit d12fda5e21
5 changed files with 30 additions and 7 deletions

View File

@@ -1,9 +1,11 @@
private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
private ["_notClosest","_playerDistance","_nearPlayers","_playerNear"];
_notClosest = false;
if (!isNull _this) then {
_nearPlayers = _this nearEntities ["CAManBase", 12];
_playerNear = ({isPlayer _x} count _nearPlayers) > 1;
_notClosest = false;
if (_playerNear) then {
// check if another player is closer
_playerDistance = player distance _this;
@@ -11,8 +13,6 @@ if (!isNull _this) then {
if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
} count _nearPlayers;
};
} else {
_notClosest = false;
};
_notClosest