From 4e38da394e8ff8d5c8c04d46cc75828c8a73bd14 Mon Sep 17 00:00:00 2001 From: dayz10k Date: Wed, 6 Nov 2013 14:01:13 -0500 Subject: [PATCH] Update player_build.sqf -updated isOnRoad check -added check to deny building tanktraps underground #661 --- SQF/dayz_code/actions/player_build.sqf | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index fbd3eb4e0..b1853b3b1 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -112,6 +112,7 @@ if((count _offset) <= 0) then { _isPole = (_classname == "Plastic_Pole_EP1_DZ"); _isLandFireDZ = (_classname == "Land_Fire_DZ"); +_isTankTrap = (_classname == "Hedgehog_DZ"); _distance = 30; _needText = "Plot Pole"; @@ -318,6 +319,14 @@ if (_hasrequireditem) then { diag_log format["DEBUG BUILDING POS: %1", _position]; deleteVehicle _object; }; + + if((_isTankTrap) and ((_position select 2)< 0)) exitWith { + _isOk = false; + _cancel = true; + _reason = "You cannot place TankTraps underground)."; + detach _object; + deleteVehicle _object; + }; if(_location1 distance _location2 > 5) exitWith { _isOk = false; @@ -365,7 +374,7 @@ if (_hasrequireditem) then { }; // No building on roads - if (isOnRoad _location) then { _cancel = true; _reason = "Cannot build on a road."; }; + if (isOnRoad _position) then { _cancel = true; _reason = "Cannot build on a road."; }; // No building in trader zones if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };