diff --git a/SQF/dayz_code/compile/fn_check_access.sqf b/SQF/dayz_code/compile/fn_check_access.sqf index 8031a283c..b0dadfd18 100644 --- a/SQF/dayz_code/compile/fn_check_access.sqf +++ b/SQF/dayz_code/compile/fn_check_access.sqf @@ -32,8 +32,8 @@ private [ ,"_isPlotOwner" // return value ,"_isPlotFriend" // return value ,"_isPlotAdmin" // return value - ,"_isTargetFriend" // return value - ,"_isTargetAdmin" // return value + ,"_isDoorFriend" // Only applicable if target is a door + ,"_isDoorAdmin" // Only applicable if target is a door ,"_targetType" // return value ,"_targetOwnerUID" // UID or characterID of the owner of _target ,"_playerUID" // UID of the _player @@ -43,7 +43,7 @@ private [ ,"_nearestPlot" // plot object ,"_plotOwnerUID" // plot owner's UID ,"_plotFriends" // list of plot friends [["UID", "Name"], ..] - ,"_targetFriends" // list of target friends [["UID", "Name"], ..] + ,"_doorFriends" // list of door friends [["UID", "Name"], ..] ]; @@ -57,8 +57,8 @@ _isFriendly = false; _isPlotOwner = false; _isPlotFriend = false; _isPlotAdmin = false; -_isTargetFriend = false; -_isTargetAdmin = false; +_isDoorFriend = false; +_isDoorAdmin = false; _targetType = ""; @@ -120,16 +120,16 @@ if(_isNearPlot) then { if(_targetType == "DOOR") then { // determine door friends // and check if player is one of them - _isTargetFriend = _isOwner; // Door owner is always a door friend - _targetFriends = _target getVariable ["doorfriends",[]]; + _isDoorFriend = _isOwner; // Door owner is always a door friend + _doorFriends = _target getVariable ["doorfriends",[]]; { - if( (_x select 0) == _playerUID ) then { _isTargetFriend = true; }; - } count _targetFriends; + if( (_x select 0) == _playerUID ) then { _isDoorFriend = true; }; + } count _doorFriends; // determine door management admins // and check if player is one of them - if(_playerUID in DZE_DoorManagementAdmins) then { _isTargetAdmin = true; }; + if(_playerUID in DZE_DoorManagementAdmins) then { _isDoorAdmin = true; }; }; @@ -139,7 +139,7 @@ if(_targetType == "DOOR") then { , _isPlotOwner , _isPlotFriend , _isPlotAdmin -, _isTargetFriend -, _isTargetAdmin +, _isDoorFriend +, _isDoorAdmin , _targetType ] diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 45d4eccb4..43cd4e48c 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -14,7 +14,7 @@ private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles", "_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock", "_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo", "_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar", -"_isPlane"]; +"_isPlane","_allowed"]; _vehicle = vehicle player; _inVehicle = (_vehicle != player); @@ -664,12 +664,11 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur s_player_breakinhouse = -1; };*/ if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {_canDo && speed player <= 1}) then { + _isOwner = [player, _cursorTarget] call FNC_check_access; + _allowed = ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4)); if (DZE_permanentPlot) then { - if (s_player_plotManagement < 0) then { - _isOwner = [player, _cursorTarget] call FNC_check_access; - if ((_isOwner select 0) or (_isOwner select 2) or (_isOwner select 3) or (_isOwner select 4)) then { - s_player_plotManagement = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false]; - }; + if (s_player_plotManagement < 0 && _allowed) then { + s_player_plotManagement = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false]; }; } else { if (s_player_maintain_area < 0) then { @@ -678,15 +677,12 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur s_player_maintain_area_preview = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\plotManagement\maintain_area.sqf", "preview", 5, false]; }; }; - if (s_player_plot_boundary < 0) then { + if (s_player_plot_boundary < 0 && (_allowed or (_isOwner select 1))) then { s_player_plot_boundary = player addAction [localize "STR_EPOCH_PLOTMANAGEMENT_SHOW_BOUNDARY", "\z\addons\dayz_code\actions\plotManagement\plotToggleMarkers.sqf", "", 1, false]; }; if (DZE_permanentPlot && DZE_PlotOwnership) then { - if (s_player_plot_take_ownership < 0) then { - _isOwner = [player, _cursorTarget] call FNC_check_access; - if (_isOwner select 0) then { - s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false]; - }; + if (s_player_plot_take_ownership < 0 && (_isOwner select 0)) then { + s_player_plot_take_ownership = player addAction [localize "STR_EPOCH_APLOTFORLIFE_TAKE_PLOT_OWNERSHIP", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false]; }; }; } else {