mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Fix _distance in dze_buildChecks
Passing false as the second parameter to fnc_find_plots always returns DZE_PlotPole select 0. In dze_buildchecks we want to use DZE_PlotPole select 1 if the classname is a plot pole. _distance is already defined as DZE_PlotPole select 0 in the other three files, so it is redundant to redefine it as the return value. In player_upgrade.sqf the check for DZE_permanentPlot is not necessary, because FNC_check_access handles both cases.
This commit is contained in:
@@ -15,7 +15,6 @@ _needText = localize "str_epoch_player_246";
|
||||
_playerUID = [player] call FNC_GetPlayerUID;
|
||||
_canBuildOnPlot = false;
|
||||
_plotcheck = [player, false] call FNC_find_plots;
|
||||
_distance = _plotcheck select 0;
|
||||
_IsNearPlot = _plotcheck select 1;
|
||||
_nearestPole = _plotcheck select 2;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
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","_friendlies","_nearestPole","_ownerID","_distance","_needText","_findNearestPoles","_findNearestPole","_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","_canBuildOnPlot","_nearestPole","_ownerID","_distance","_needText","_IsNearPlot"];
|
||||
|
||||
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_52" call dayz_rollingMessages;};
|
||||
DZE_ActionInProgress = true;
|
||||
@@ -14,7 +14,6 @@ _needText = localize "str_epoch_player_246";
|
||||
_canBuildOnPlot = false;
|
||||
|
||||
_plotcheck = [player, false] call FNC_find_plots;
|
||||
_distance = _plotcheck select 0;
|
||||
_IsNearPlot = _plotcheck select 1;
|
||||
_nearestPole = _plotcheck select 2;
|
||||
|
||||
@@ -25,18 +24,11 @@ if(_IsNearPlot == 0) then {
|
||||
if(dayz_characterID == _ownerID) then {
|
||||
_canBuildOnPlot = true;
|
||||
} else {
|
||||
if (DZE_permanentPlot) then {
|
||||
_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;
|
||||
};
|
||||
} else {
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
if(_ownerID in _friendlies) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
_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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ DZE_ActionInProgress = true;
|
||||
delete object from db with extra waiting by [VB]AWOL
|
||||
parameters: _obj
|
||||
*/
|
||||
private ["_activatingPlayer","_obj","_playerUID","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular"];
|
||||
private ["_activatingPlayer","_obj","_playerUID","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular"];
|
||||
|
||||
player removeAction s_player_deleteBuild;
|
||||
s_player_deleteBuild = 1;
|
||||
@@ -54,7 +54,6 @@ else {
|
||||
};
|
||||
|
||||
_plotcheck = [player, false] call FNC_find_plots;
|
||||
_distance = _plotcheck select 0;
|
||||
_IsNearPlot = _plotcheck select 1;
|
||||
_nearestPole = _plotcheck select 2;
|
||||
|
||||
|
||||
@@ -21,12 +21,9 @@ _canBuild = false;
|
||||
_nearestPole = objNull;
|
||||
_ownerID = 0;
|
||||
_friendlies = [];
|
||||
|
||||
_distance = DZE_PlotPole select 0;
|
||||
_needText = localize "str_epoch_player_246";
|
||||
|
||||
_plotcheck = [player, false] call FNC_find_plots;
|
||||
_distance = _plotcheck select 0;
|
||||
_IsNearPlot = _plotcheck select 1;
|
||||
_nearestPole = _plotcheck select 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user