mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Add a few missing playerIsNear checks
Blocks duping method reported by Sercan and confirmed with @oiad . Thanks
This commit is contained in:
@@ -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
|
||||
@@ -14,9 +14,14 @@ if (DZE_permanentPlot) then {
|
||||
_ownerID = _obj getVariable["ownerPUID","0"];
|
||||
};
|
||||
|
||||
// Make sure you are the closest player to the tent
|
||||
_playerNear = _obj call dze_isnearest_player;
|
||||
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_16" call dayz_rollingMessages;};
|
||||
|
||||
// Make sure no other players are nearby
|
||||
_playerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase",10]) > 1;
|
||||
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
|
||||
_packobj = getText (configFile >> "CfgVehicles" >> typeOf _obj >> "pack");
|
||||
|
||||
player removeAction s_player_packtent;
|
||||
|
||||
Reference in New Issue
Block a user