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

@@ -87,6 +87,7 @@
[FIXED] Vehicle lock and unlock actions are now refreshed correctly without needing to look away and back again. @oiad [FIXED] Vehicle lock and unlock actions are now refreshed correctly without needing to look away and back again. @oiad
[FIXED] A potential undefined error on bear trap trigger. @oiad [FIXED] A potential undefined error on bear trap trigger. @oiad
[FIXED] A few floating loot positions in firestation. [FIXED] A few floating loot positions in firestation.
[FIXED] Blocked a duping method involving changing clothes. Thanks to Sercan for reporting. @oiad
[NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php) [NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade [FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade

View File

@@ -9,10 +9,13 @@
}; };
*/ */
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig", private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis", "_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object", "_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector"]; "_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear"];
_cursorTarget = _this select 3; _cursorTarget = _this select 3;
@@ -52,7 +55,15 @@ _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = []; _upgradeParts = [];
_startUpgrade = true; _startUpgrade = true;
if(_isWater or _onLadder) exitWith { localize "str_CannotUpgrade" call dayz_rollingMessages; }; if(_isWater or _onLadder) exitWith {dayz_actionInProgress = false; localize "str_CannotUpgrade" call dayz_rollingMessages;};
// Make sure you are the closest player to the object
_playerNear = _cursorTarget call dze_isnearest_player;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
// Make sure no other players are nearby
_playerNear = {isPlayer _x} count (([_cursorTarget] call FNC_GetPos) nearEntities ["CAManBase",10]) > 1;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
// lets check player has requiredTools for upgrade // lets check player has requiredTools for upgrade
{ {
@@ -197,4 +208,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
} else { } else {
localize "str_upgradeNoOption" call dayz_rollingMessages; localize "str_upgradeNoOption" call dayz_rollingMessages;
*/ */
}; };
dayz_actionInProgress = false;

View File

@@ -1,6 +1,10 @@
if (dayz_lastClothesChange + 5 > diag_tickTime) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; if (dayz_lastClothesChange + 5 > diag_tickTime) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_lastClothesChange = diag_tickTime; dayz_lastClothesChange = diag_tickTime;
// Make sure no other players are nearby
_playerNear = {isPlayer _x} count (([player] call FNC_GetPos) nearEntities ["CAManBase",12]) > 1;
if (_playerNear) exitWith {localize "STR_EPOCH_PLAYER_84" call dayz_rollingMessages;};
if (_this in DZE_RestrictSkins) exitWith { format[localize "str_epoch_player_315",_this] call dayz_rollingMessages; }; if (_this in DZE_RestrictSkins) exitWith { format[localize "str_epoch_player_315",_this] call dayz_rollingMessages; };
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_83" call dayz_rollingMessages;}; if (dayz_actionInProgress) exitWith {localize "str_epoch_player_83" call dayz_rollingMessages;};
dayz_actionInProgress = true; dayz_actionInProgress = true;

View File

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

View File

@@ -14,9 +14,14 @@ if (DZE_permanentPlot) then {
_ownerID = _obj getVariable["ownerPUID","0"]; _ownerID = _obj getVariable["ownerPUID","0"];
}; };
// Make sure you are the closest player to the tent
_playerNear = _obj call dze_isnearest_player; _playerNear = _obj call dze_isnearest_player;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_16" call dayz_rollingMessages;}; 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"); _packobj = getText (configFile >> "CfgVehicles" >> typeOf _obj >> "pack");
player removeAction s_player_packtent; player removeAction s_player_packtent;