Update fn_SpawnNonPersistentVehicle.sqf

Make sure area to spawn vehicle is clear
This commit is contained in:
MGT 2019-11-17 13:37:23 +00:00 committed by GitHub
parent 6d45755efc
commit 14f156330a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,10 @@ if !(isClass (configFile >> "CfgVehicles" >> _vehicleClass)) exitWith
objNull
};
//make sure area to spawn vehicle is clear
_objs = nearestTerrainObjects [_position, ["TREE","BUSH","SMALL TREE","ROCK","ROCKS","FENCE","WALL"], 50];
{ _x hideObjectGlobal true; } forEach _objs;
private _vehObj = createVehicle [_vehicleClass, _position, [], 0, "NONE"];
clearWeaponCargoGlobal _vehObj;