mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improve Performance from updateTrajectoryPFH in Winddeflection (#7700)
This commit is contained in:
parent
6a59bf2a6c
commit
3a13dd416a
@ -25,6 +25,7 @@
|
||||
_args set [0, CBA_missionTime];
|
||||
private _isWind = (vectorMagnitude wind > 0);
|
||||
|
||||
private _deleted = false;
|
||||
{
|
||||
_x params ["_bullet", "_airFriction"];
|
||||
|
||||
@ -32,7 +33,8 @@
|
||||
private _bulletSpeedSqr = vectorMagnitudeSqr _bulletVelocity;
|
||||
|
||||
if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeedSqr < 10000}}) then {
|
||||
GVAR(trackedBullets) deleteAt (GVAR(trackedBullets) find _x);
|
||||
GVAR(trackedBullets) set [_forEachIndex, objNull];
|
||||
_deleted = true;
|
||||
} else {
|
||||
if (_isWind) then {
|
||||
private _trueVelocity = _bulletVelocity vectorDiff wind;
|
||||
@ -48,7 +50,11 @@
|
||||
};
|
||||
_bullet setVelocity _bulletVelocity;
|
||||
};
|
||||
nil
|
||||
} count +GVAR(trackedBullets);
|
||||
} forEach GVAR(trackedBullets);
|
||||
|
||||
if (_deleted) then {
|
||||
GVAR(trackedBullets) = GVAR(trackedBullets) - [objNull];
|
||||
};
|
||||
|
||||
// END_COUNTER(pfeh);
|
||||
}, GVAR(simulationInterval), [CBA_missionTime]] call CBA_fnc_addPerFrameHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user