mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Don't pass DZE_plotManagement to fn_check_owner
The whole point of a global variable is you do not need to pass it. DZE_plotManagement and DZE_plotmanagementAdmins are always defined and do not change, so there is no need to pass them as parameters.
This commit is contained in:
@@ -15,7 +15,7 @@ _changecount = 0;
|
||||
|
||||
// Check is owner of the plot pole.
|
||||
|
||||
_isowner = [player, _plotpole, DZE_plotManagement] call FNC_check_owner;
|
||||
_isowner = [player, _plotpole] call FNC_check_owner;
|
||||
_itemsExist = false;
|
||||
|
||||
if ((_isowner select 0 )) then {
|
||||
@@ -25,7 +25,7 @@ if ((_isowner select 0 )) then {
|
||||
_classname = typeOf _object;
|
||||
if (_classname in DZE_plotTakeOwnershipItems)then {
|
||||
|
||||
_isowner = [player, _object, DZE_plotManagement] call FNC_check_owner;
|
||||
_isowner = [player, _object] call FNC_check_owner;
|
||||
diag_log text "Plot Take Ownership: Object in DZE_plotTakeOwnershipItems";
|
||||
|
||||
if !( _isowner select 0 ) then{
|
||||
|
||||
@@ -27,7 +27,7 @@ if(_IsNearPlot == 0) then {
|
||||
_canBuildOnPlot = true;
|
||||
} else {
|
||||
if (DZE_plotManagement || DZE_plotforLife) then {
|
||||
_buildcheck = [player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
_buildcheck = [player, _nearestPole] call FNC_check_owner;
|
||||
_isowner = _buildcheck select 0;
|
||||
_isfriendly = _buildcheck select 1;
|
||||
if (_isowner || _isfriendly) then {
|
||||
|
||||
@@ -26,7 +26,7 @@ if(_IsNearPlot == 0) then {
|
||||
_canBuildOnPlot = true;
|
||||
} else {
|
||||
if (DZE_plotManagement || DZE_plotforLife) then {
|
||||
_buildcheck = [player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
_buildcheck = [player, _nearestPole] call FNC_check_owner;
|
||||
_isowner = _buildcheck select 0;
|
||||
_isfriendly = _buildcheck select 1;
|
||||
if (_isowner || _isfriendly) then {
|
||||
|
||||
@@ -60,7 +60,7 @@ _nearestPole = _plotcheck select 2;
|
||||
|
||||
if(_IsNearPlot >= 1) then {
|
||||
// Since there are plot poles nearby we need to check ownership && friend status
|
||||
_buildcheck = [player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
_buildcheck = [player, _nearestPole] call FNC_check_owner;
|
||||
_isowner = _buildcheck select 0;
|
||||
_isfriendly = _buildcheck select 1;
|
||||
if (!_isowner && !_isfriendly) then {
|
||||
|
||||
@@ -4,15 +4,14 @@ private ["_player","_object","_playerUID","_ObjectOwner","_owner","_friendlies",
|
||||
|
||||
_player = _this select 0;
|
||||
_Object = _this select 1;
|
||||
_PlotManagement = _this select 2;
|
||||
|
||||
_Owner = false;
|
||||
_friendly = false;
|
||||
_friendlies = [];
|
||||
_ObjectOwner = "0";
|
||||
|
||||
if (_PlotManagement) then {
|
||||
_friendlies = [_Object, true, false] call dze_getPlotFriends;
|
||||
if (DZE_plotManagement) then {
|
||||
_friendlies = [_Object, true] call dze_getPlotFriends;
|
||||
} else {
|
||||
_friendlies = _player getVariable ["friendlyTo",[]];
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ if(_IsNearPlot == 0) then {
|
||||
_canBuild = true;
|
||||
} else {
|
||||
if (DZE_plotManagement || DZE_plotforLife) then {
|
||||
_buildcheck = [player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
_buildcheck = [player, _nearestPole] call FNC_check_owner;
|
||||
_isowner = _buildcheck select 0;
|
||||
_isfriendly = _buildcheck select 1;
|
||||
if (_isowner || _isfriendly) then {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/************************************************************************************************************************************************
|
||||
This file is used to obtain plot pole owners and friends, which includes plot management admins depending on the third array element passed to the script
|
||||
This file is used to obtain plot pole owners and friends, which includes plot management admins.
|
||||
You should NOT call this file directly, you should call FNC_check_owner as below to obtain a list of the plot owner and friends.
|
||||
[player, _nearestPole, DZE_plotManagement] call FNC_check_owner;
|
||||
[player, _cursorTarget] call FNC_check_owner;
|
||||
************************************************************************************************************************************************/
|
||||
|
||||
private ["_findNearestPoles","_AdminAccess","_IsNearPlot","_pole","_friendUID","_owner","_allowed","_friends","_FindNearestPole"];
|
||||
private ["_findNearestPoles","_IsNearPlot","_pole","_friendUID","_owner","_allowed","_friends","_FindNearestPole"];
|
||||
_pole = _this select 0;
|
||||
_FindNearestPole = _this select 1;
|
||||
_AdminAccess = _this select 2;
|
||||
|
||||
_IsNearPlot = 0;
|
||||
_allowed = [];
|
||||
if (_FindNearestPole) then {
|
||||
@@ -23,7 +23,7 @@ if(!_FindNearestPole || {_IsNearPlot > 0}) then {
|
||||
_friendUID = _x select 0;
|
||||
_allowed set [(count _allowed), _friendUID];
|
||||
} count _friends;
|
||||
if (_AdminAccess) then {
|
||||
if (count DZE_PlotManagementAdmins > 0) then {
|
||||
_allowed = _allowed + DZE_PlotManagementAdmins;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -215,7 +215,7 @@ if (isPlayer cursorTarget) then {
|
||||
if (DZE_plotforLife) then {
|
||||
_charID = [_unit] call FNC_GetPlayerUID;
|
||||
};
|
||||
_friendlies = [player, _unit, DZE_plotManagement] call FNC_check_owner;
|
||||
_friendlies = [player, _unit] call FNC_check_owner;
|
||||
if !(_charID in _friendlies) then {
|
||||
r_action = true;
|
||||
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true];
|
||||
|
||||
@@ -420,7 +420,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
|
||||
if(_isModular || _isModularDoor || {_typeOfCursorTarget in DZE_isDestroyableStorage}) then {
|
||||
if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then {
|
||||
_isowner = [player, _cursorTarget, DZE_plotManagement] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
_isowner = [player, _cursorTarget] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
If ((_isowner select 0) || (_isowner select 1)) then {
|
||||
_player_deleteBuild = true;
|
||||
};
|
||||
@@ -633,7 +633,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
if ((_cursorTarget isKindOf "Plastic_Pole_EP1_DZ") && {_canDo && speed player <= 1}) then {
|
||||
if( DZE_plotManagement || DZE_plotforLife) then {
|
||||
if (s_player_plotManagement < 0) then {
|
||||
_isowner = [player, _cursorTarget, DZE_plotManagement] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
_isowner = [player, _cursorTarget] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
If ((_isowner select 0) || (_isowner select 1)) then {
|
||||
s_player_plot_take_ownership = player addAction ["Take plot items ownership", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false];
|
||||
};
|
||||
@@ -660,7 +660,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
||||
if (DZE_plotforLife) then {
|
||||
if (s_player_plot_take_ownership < 0) then {
|
||||
if (DZE_PlotOwnership) then {
|
||||
_isowner = [player, _cursorTarget, DZE_plotManagement] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
_isowner = [player, _cursorTarget] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies
|
||||
If (_isowner select 0) then {
|
||||
s_player_plot_take_ownership = player addAction ["Take plot items ownership", "\z\addons\dayz_code\actions\A_Plot_for_Life\plot_take_ownership.sqf", "", 1, false];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user