mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed an issue with fragments being created above water for explosions below the surface
This commit is contained in:
parent
e2dce5e102
commit
b9aa3cb65b
@ -41,7 +41,7 @@ _maxFragCount = switch (true) do {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Spawn the fragment spawner
|
// Spawn the fragment spawner
|
||||||
private _fragSpawner = createVehicle [_type + _maxFragCount + _hMode, ASLToATL _posASL, [], 0, "CAN_COLLIDE"];
|
private _fragSpawner = createVehicle [_type + _maxFragCount + _hMode, ASLToAGL _posASL, [], 0, "CAN_COLLIDE"];
|
||||||
private _randDir = random 360;
|
private _randDir = random 360;
|
||||||
_fragSpawner setVectorDirandUp [[0,0,-1], [cos _randDir, sin _randDir,0]];
|
_fragSpawner setVectorDirandUp [[0,0,-1], [cos _randDir, sin _randDir,0]];
|
||||||
_fragSpawner setVelocity (_projectileVelocity vectorAdd [0, 0, -0.5*_fragVelocity]);
|
_fragSpawner setVelocity (_projectileVelocity vectorAdd [0, 0, -0.5*_fragVelocity]);
|
||||||
|
@ -38,9 +38,10 @@ if (_fragTypes isEqualTo []) then {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _posAGL = ASLToAGL _posASL;
|
||||||
// Post 2.18 change - uncomment line 41, and remove lines 43, 50-55, 64-66
|
// Post 2.18 change - uncomment line 41, and remove lines 43, 50-55, 64-66
|
||||||
// private _targets = [ASLToAGL _posASL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true];
|
// private _targets = [ASLToAGL _posASL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true];
|
||||||
private _objects = (ASLToAGL _posASL) nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange];
|
private _objects = _posAGL nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange];
|
||||||
if (_objects isEqualTo []) exitWith {
|
if (_objects isEqualTo []) exitWith {
|
||||||
TRACE_2("No nearby targets",_posASL,_fragRange);
|
TRACE_2("No nearby targets",_posASL,_fragRange);
|
||||||
0
|
0
|
||||||
@ -152,7 +153,7 @@ private _totalFragCount = 0;
|
|||||||
|
|
||||||
// Create fragment
|
// Create fragment
|
||||||
private _vectorDir = _posASL vectorFromTo _targetPos;
|
private _vectorDir = _posASL vectorFromTo _targetPos;
|
||||||
private _fragObj = createVehicle [_fragSpawner, ASLtoATL _posASL, [], 0, "CAN_COLLIDE"];
|
private _fragObj = createVehicle [_fragSpawner, _posAGL, [], 0, "CAN_COLLIDE"];
|
||||||
_fragObj setVectorDir _vectorDir;
|
_fragObj setVectorDir _vectorDir;
|
||||||
_fragObj setVelocity (_vectorDir vectorMultiply _locFragVel);
|
_fragObj setVelocity (_vectorDir vectorMultiply _locFragVel);
|
||||||
_fragObj setShotParents _shotParents;
|
_fragObj setShotParents _shotParents;
|
||||||
|
Loading…
Reference in New Issue
Block a user