Prevent debris from spawning inside Vehicles

This commit is contained in:
He-Man 2018-07-11 15:35:53 +02:00
parent b2cd465fbf
commit 7fe6974a50

View File

@ -97,6 +97,9 @@ if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
if !(isNull _intersectObject) then { if !(isNull _intersectObject) then {
_allowDebris = !((typeOf _intersectObject) in _debris); _allowDebris = !((typeOf _intersectObject) in _debris);
}; };
if (_allowDebris) then {
_allowDebris = ((ASLtoATL _intersectPosASL) nearentities [["Landvehicle","SHIP","AIR","TANK"],15]) isequalto [];
};
if (_allowDebris) then { if (_allowDebris) then {
_object = createSimpleObject [_selectedDebris, _intersectPosASL]; _object = createSimpleObject [_selectedDebris, _intersectPosASL];
_object setDir random 360; _object setDir random 360;
@ -117,10 +120,12 @@ if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
if (_debrisCounter >= _maxDebrisLimit) exitWith {}; if (_debrisCounter >= _maxDebrisLimit) exitWith {};
if (_x isEqualType [] && !(_x isEqualTo [])) then { if (_x isEqualType [] && !(_x isEqualTo [])) then {
_x params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"]; _x params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"];
_object = createSimpleObject [_selectedDebris, _posWorld]; if (((ASLtoATL _posWorld) nearentities [["Landvehicle","SHIP","AIR","TANK"],15]) isequalto []) then {
_object setPosWorld _posWorld; _object = createSimpleObject [_selectedDebris, _posWorld];
_object setVectorDirAndUp [_vectorDir,_vectorUp]; _object setPosWorld _posWorld;
_debrisCounter = _debrisCounter + 1; _object setVectorDirAndUp [_vectorDir,_vectorUp];
_debrisCounter = _debrisCounter + 1;
};
}; };
} forEach _debrisLocations; } forEach _debrisLocations;