mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Shorten DZE_maintainClasses checks
This commit is contained in:
@@ -1255,9 +1255,7 @@ if (_canBuild) then {
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if (!_cancel) then {
|
if (!_cancel) then {
|
||||||
_buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_storage_base"];
|
if (_isPole && ((count (nearestObjects [_modelCenterPos, DZE_maintainClasses, DZE_maintainRange])) >= DZE_BuildingLimit)) then {
|
||||||
|
|
||||||
if (_isPole && ((count (nearestObjects [_modelCenterPos, _buildables, DZE_maintainRange])) >= DZE_BuildingLimit)) then {
|
|
||||||
_cancel = true;
|
_cancel = true;
|
||||||
_reason = format[localize "str_epoch_player_41", floor DZE_maintainRange]; // You cannot build. There are too many objects within %1m.
|
_reason = format[localize "str_epoch_player_41", floor DZE_maintainRange]; // You cannot build. There are too many objects within %1m.
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
private ["_range","_buildables","_count","_colour","_ctrl","_target"];
|
private ["_range","_count","_colour","_ctrl","_target"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_range = DZE_PlotPole select 0;
|
_range = DZE_PlotPole select 0;
|
||||||
_target = (([player] call FNC_getPos) nearEntities ["Plastic_Pole_EP1_DZ",15]) 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
|
// Also count safes, lockboxes, vanilla buildables, tents and stashes against DZE_BuildingLimit
|
||||||
_buildables = DZE_maintainClasses + DZE_LockableStorage + ["DZ_storage_base"];
|
_count = count (nearestObjects [_target,DZE_maintainClasses,_range]);
|
||||||
_count = count (nearestObjects [_target,_buildables,_range]);
|
|
||||||
|
|
||||||
_colour = "#ffffff";
|
_colour = "#ffffff";
|
||||||
|
|
||||||
|
|||||||
@@ -227,14 +227,13 @@ if (_message != "") exitWith {
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Also count safes, lockboxes, vanilla buildables, tents and stashes against DZE_BuildingLimit
|
// 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 {
|
local _center = if (isNull _nearestPole) then {
|
||||||
_pos; // player's position
|
_pos; // player's position
|
||||||
} else {
|
} else {
|
||||||
_nearestPole;
|
_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;
|
dayz_actionInProgress = false;
|
||||||
format[localize "str_epoch_player_41", floor DZE_maintainRange] call dayz_rollingMessages;
|
format[localize "str_epoch_player_41", floor DZE_maintainRange] call dayz_rollingMessages;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user