From ff5f5612b07788d4d9eb862a61acded1a363bb81 Mon Sep 17 00:00:00 2001 From: A Man Date: Tue, 24 May 2022 13:14:02 +0200 Subject: [PATCH] Shorten DZE_maintainClasses checks --- SQF/dayz_code/actions/modular_build.sqf | 4 +--- SQF/dayz_code/actions/plotManagement/plotObjects.sqf | 5 ++--- SQF/dayz_code/compile/dze_buildChecks.sqf | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/SQF/dayz_code/actions/modular_build.sqf b/SQF/dayz_code/actions/modular_build.sqf index 28f5590e2..14880d8c7 100644 --- a/SQF/dayz_code/actions/modular_build.sqf +++ b/SQF/dayz_code/actions/modular_build.sqf @@ -1255,9 +1255,7 @@ if (_canBuild) then { /////////////////////////////////////////////////////////////////////////////////////////// if (!_cancel) then { - _buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_storage_base"]; - - if (_isPole && ((count (nearestObjects [_modelCenterPos, _buildables, DZE_maintainRange])) >= DZE_BuildingLimit)) then { + if (_isPole && ((count (nearestObjects [_modelCenterPos, DZE_maintainClasses, DZE_maintainRange])) >= DZE_BuildingLimit)) then { _cancel = true; _reason = format[localize "str_epoch_player_41", floor DZE_maintainRange]; // You cannot build. There are too many objects within %1m. }; diff --git a/SQF/dayz_code/actions/plotManagement/plotObjects.sqf b/SQF/dayz_code/actions/plotManagement/plotObjects.sqf index ac8dc8eae..6beb2273b 100644 --- a/SQF/dayz_code/actions/plotManagement/plotObjects.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotObjects.sqf @@ -1,11 +1,10 @@ -private ["_range","_buildables","_count","_colour","_ctrl","_target"]; +private ["_range","_count","_colour","_ctrl","_target"]; disableSerialization; _range = DZE_PlotPole select 0; _target = (([player] call FNC_getPos) nearEntities ["Plastic_Pole_EP1_DZ",15]) select 0; // Also count safes, lockboxes, vanilla buildables, tents and stashes against DZE_BuildingLimit -_buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_storage_base"]; -_count = count (nearestObjects [_target,_buildables,_range]); +_count = count (nearestObjects [_target,DZE_maintainClasses,_range]); _colour = "#ffffff"; diff --git a/SQF/dayz_code/compile/dze_buildChecks.sqf b/SQF/dayz_code/compile/dze_buildChecks.sqf index 9450325ad..79e1b4fb8 100644 --- a/SQF/dayz_code/compile/dze_buildChecks.sqf +++ b/SQF/dayz_code/compile/dze_buildChecks.sqf @@ -227,14 +227,13 @@ if (_message != "") exitWith { /////////////////////////////////////////////////////////////////////////////////////////////////// // Also count safes, lockboxes, vanilla buildables, tents and stashes against DZE_BuildingLimit -local _buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_storage_base"]; local _center = if (isNull _nearestPole) then { _pos; // player's position } else { _nearestPole; }; -if ((count (nearestObjects [_center, _buildables, DZE_maintainRange])) >= DZE_BuildingLimit) exitWith { +if ((count (nearestObjects [_center, DZE_maintainClasses, DZE_maintainRange])) >= DZE_BuildingLimit) exitWith { dayz_actionInProgress = false; format[localize "str_epoch_player_41", floor DZE_maintainRange] call dayz_rollingMessages;