mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Use nearEntities for empty drivable vehicles
NearEntities is faster and works fine for empty drivable vehicles that are not destroyed.
This commit is contained in:
@@ -13,7 +13,7 @@ _towTruckSize = (sizeOf typeOf _towTruck);
|
|||||||
_allowedSize = _towTruckSize-(_towTruckSize/3);
|
_allowedSize = _towTruckSize-(_towTruckSize/3);
|
||||||
|
|
||||||
// Get all nearby vehicles within 10m
|
// Get all nearby vehicles within 10m
|
||||||
_findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10];
|
_findNearestVehicles = _towTruck nearEntities [["Car","Motorcycle"],10];
|
||||||
_findNearestVehicle = [];
|
_findNearestVehicle = [];
|
||||||
{
|
{
|
||||||
if (alive _x && _towTruck != _x) then {
|
if (alive _x && _towTruck != _x) then {
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance curso
|
|||||||
//diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
|
//diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow];
|
||||||
|
|
||||||
if (_allowTow) then {
|
if (_allowTow) then {
|
||||||
_liftHelis = nearestObjects [player, DZE_HeliAllowTowFrom, 15];
|
_liftHelis = player nearEntities [DZE_HeliAllowTowFrom,15];
|
||||||
{
|
{
|
||||||
if(!_found) then {
|
if(!_found) then {
|
||||||
_posL = [_x] call FNC_getPos;
|
_posL = [_x] call FNC_getPos;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ _upgrade = _this;
|
|||||||
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_18"), "PLAIN DOWN"]};
|
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_18"), "PLAIN DOWN"]};
|
||||||
|
|
||||||
// look for nearest empty vehicle
|
// look for nearest empty vehicle
|
||||||
_findNearestVehicles = nearestObjects [player, ["LandVehicle"], 10];
|
_findNearestVehicles = player nearEntities [["LandVehicle"],10];
|
||||||
_findNearestVehicle = [];
|
_findNearestVehicle = [];
|
||||||
{
|
{
|
||||||
if (alive _x && (count (crew _x)) == 0) exitWith {
|
if (alive _x && (count (crew _x)) == 0) exitWith {
|
||||||
@@ -129,7 +129,7 @@ if (_IsNearVehicle >= 1) then {
|
|||||||
publicVariableServer "PVDZE_veh_Upgrade";
|
publicVariableServer "PVDZE_veh_Upgrade";
|
||||||
|
|
||||||
cutText [(localize "STR_EPOCH_VEHUP_SUCCESS"), "PLAIN DOWN"];
|
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 {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user