Remove redundant access checks for upgrade and downgrade

Access control for upgrade and downgrade is now included in
fn_selfActions as per #1706

I moved _upgrade down in fn_selfActions so it is only checked it if the
right conditions are met.
This commit is contained in:
ebaydayz
2016-07-09 14:34:38 -04:00
parent 326fda70b1
commit 4ff088c80c
4 changed files with 4 additions and 62 deletions

View File

@@ -2,39 +2,13 @@
DayZ Base Building Upgrades
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_canBuildOnPlot","_nearestPole","_ownerID","_distance","_needText","_IsNearPlot"];
private ["_location","_dir","_classname","_missing","_text","_proceed","_num_removed","_object","_missingQty","_itemIn","_countIn","_qty","_removed","_removed_total","_tobe_removed_total","_objectID","_objectUID","_temp_removed_array","_textMissing","_newclassname","_requirements","_obj","_upgrade","_lockable","_combination_1","_combination_2","_combination_3","_combination","_objectCharacterID","_ownerID"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_52" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
player removeAction s_player_upgrade_build;
s_player_upgrade_build = 1;
_distance = DZE_PlotPole select 0;
_needText = localize "str_epoch_player_246";
_canBuildOnPlot = false;
_plotcheck = [player, false] call FNC_find_plots;
_IsNearPlot = _plotcheck select 1;
_nearestPole = _plotcheck select 2;
if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
_ownerID = _nearestPole getVariable["CharacterID","0"];
if(dayz_characterID == _ownerID) then {
_canBuildOnPlot = true;
} else {
_buildcheck = [player, _nearestPole] call FNC_check_access;
_isowner = _buildcheck select 0;
_isfriendly = ((_buildcheck select 1) or (_buildcheck select 3));
if (_isowner || _isfriendly) then {
_canBuildOnPlot = true;
};
};
};
// exit if not allowed due to plot pole
if(!_canBuildOnPlot) exitWith { DZE_ActionInProgress = false; format[localize "str_epoch_player_157",_needText,_distance] call dayz_rollingMessages; };
// get cursortarget from addaction
_obj = _this select 3;