From df76ab09cd064b03ef1bc67186c23f768b032c67 Mon Sep 17 00:00:00 2001 From: vbawol Date: Tue, 12 Feb 2013 15:15:43 -0600 Subject: [PATCH] 0.943 fixed placing vault inside building --- dayz_code/actions/vault_pitch.sqf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dayz_code/actions/vault_pitch.sqf b/dayz_code/actions/vault_pitch.sqf index dbaea5341..0ed076ac5 100644 --- a/dayz_code/actions/vault_pitch.sqf +++ b/dayz_code/actions/vault_pitch.sqf @@ -73,10 +73,13 @@ while {_isOk} do { }; detach _tmpvault; -deleteVehicle _tmpvault; + +_vault_location = (getPosATL _tmpvault); + + // Make sure vault is not placed on road. -if (isOnRoad (getPosATL player)) then { _isOk = true; diag_log ("surface is road"); }; +if (isOnRoad _vault_location) then { _isOk = true; diag_log ("surface is road"); }; // Make sure vault is not placed in trader citys if(!placevault) then { _isOk = true; diag_log ("is trader city"); }; @@ -92,6 +95,7 @@ _objectsPond = nearestObjects [_playerPos, [], 10]; }; } forEach _objectsPond; +deleteVehicle _tmpvault; if(!_cancel) then { if (!_isOk) then { @@ -111,10 +115,9 @@ if(!_cancel) then { if(_isBuilding) then { - _ppos = _building worldToModel (getPosATL player); - _ppos set [2,1.5]; - + _ppos = _building worldToModel _vault_location; _location = _building modelToWorld _ppos; + } else { _location = player modelToWorld [_offset_x,_offset_y,_offset_z]; };