From d2ba0278635a1aa1a83719c45d5199b8d481fa9e Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 28 Apr 2016 15:32:32 -0400 Subject: [PATCH] Perform build checks before removing magazines Also allow tents and stashes to be built without a plot pole (same as 1051). --- .../Configs/CfgVehicles/DZE/TentStorage.hpp | 15 +++++++++++++++ SQF/dayz_code/actions/player_buildVanilla.sqf | 9 ++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgVehicles/DZE/TentStorage.hpp b/SQF/dayz_code/Configs/CfgVehicles/DZE/TentStorage.hpp index d3d27e99d..de62959d0 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/DZE/TentStorage.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/DZE/TentStorage.hpp @@ -1,4 +1,19 @@ // DayZ tents are defined in \dayz_equip\configs\Storage.hpp +class DZ_storage_base : Land_A_tent { + //Base class for all tents and stashes. Only included here to add Epoch values. + scope=public; + armor = 5; + displayname = $STR_VEH_NAME_STASH; + icon = ""; + mapsize = 3; + transportMaxMagazines = 0; + transportMaxWeapons = 0; + transportMaxBackpacks = 0; + // Epoch values + constructioncount = 1; + requireplot = 0; + nounderground = 0; +}; class DomeTentStorage_base; class DesertTentStorage: DomeTentStorage_base { diff --git a/SQF/dayz_code/actions/player_buildVanilla.sqf b/SQF/dayz_code/actions/player_buildVanilla.sqf index c7ff12c1e..a04c140e8 100644 --- a/SQF/dayz_code/actions/player_buildVanilla.sqf +++ b/SQF/dayz_code/actions/player_buildVanilla.sqf @@ -86,6 +86,10 @@ if (!_ok) exitWith { _msg call dayz_rollingMessages; }; +_posReference = [player] call FNC_GetPos; +_canBuild = [_posReference, _item, false] call DZE_BuildChecks; +if !(_canBuild select 0) exitWith {}; + // lets check player has requiredParts for upgrade _ok = true; _upgradeParts = []; @@ -107,11 +111,6 @@ if (!_ok) exitWith { _msg call dayz_rollingMessages; }; -_posReference = [player] call FNC_GetPos; - -_canBuild = [_posReference, _item, false] call DZE_BuildChecks; -if (!(_canBuild select 0)) exitWith {}; - //localize "str_player_build_rotate" call dayz_rollingMessages; _msg = localize "str_player_build_rotate"; _msg call dayz_rollingMessages;