From 9bbeb1e43e6e06659dd7d7759f25da5ba806e519 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Mon, 22 Feb 2016 16:52:39 -0500 Subject: [PATCH] Use nearEntities for empty drivable vehicles NearEntities is faster and works fine for empty drivable vehicles that are not destroyed. --- SQF/dayz_code/actions/tow_AttachStraps.sqf | 2 +- SQF/dayz_code/compile/fn_selfActions.sqf | 2 +- SQF/dayz_code/compile/player_upgradeVehicle.sqf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/actions/tow_AttachStraps.sqf b/SQF/dayz_code/actions/tow_AttachStraps.sqf index f69e4b8a6..2b6d0fa63 100644 --- a/SQF/dayz_code/actions/tow_AttachStraps.sqf +++ b/SQF/dayz_code/actions/tow_AttachStraps.sqf @@ -13,7 +13,7 @@ _towTruckSize = (sizeOf typeOf _towTruck); _allowedSize = _towTruckSize-(_towTruckSize/3); // Get all nearby vehicles within 10m -_findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10]; +_findNearestVehicles = _towTruck nearEntities [["Car","Motorcycle"],10]; _findNearestVehicle = []; { if (alive _x && _towTruck != _x) then { diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 956dc5ec5..6fa1cc04d 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -282,7 +282,7 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow]; if (_allowTow) then { - _liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15]; + _liftHelis = player nearEntities [DZE_HeliAllowTowFrom,15]; { if(!_found) then { _posL = [_x] call FNC_getPos; diff --git a/SQF/dayz_code/compile/player_upgradeVehicle.sqf b/SQF/dayz_code/compile/player_upgradeVehicle.sqf index 143110043..3a762a4a7 100644 --- a/SQF/dayz_code/compile/player_upgradeVehicle.sqf +++ b/SQF/dayz_code/compile/player_upgradeVehicle.sqf @@ -13,7 +13,7 @@ _upgrade = _this; if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_18"), "PLAIN DOWN"]}; // look for nearest empty vehicle -_findNearestVehicles = nearestObjects [player, ["LandVehicle"], 10]; +_findNearestVehicles = player nearEntities [["LandVehicle"],10]; _findNearestVehicle = []; { if (alive _x && (count (crew _x)) == 0) exitWith { @@ -129,7 +129,7 @@ if (_IsNearVehicle >= 1) then { publicVariableServer "PVDZE_veh_Upgrade"; cutText [(localize "STR_EPOCH_VEHUP_SUCCESS"), "PLAIN DOWN"]; - {player reveal _x;} count (nearestObjects [player,["AllVehicles"],30]); + {player reveal _x;} count (player nearEntities [["LandVehicle"],10]); }; } else {