Skip to content

Commit

Permalink
Merge pull request #1445 from CBATeam/fix-projectileTracking
Browse files Browse the repository at this point in the history
Fix Projectile Tracking Heights
  • Loading branch information
commy2 committed Apr 4, 2021
2 parents df72cbe + fdb4c8d commit 92bf7f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ for "_index" from 0 to _maxLines do {
private _green = _currentSpeed / _startSpeed;
private _red = 1 - _green;

drawLine3D [_currentProjectileData select 0, _nextProjectileData select 0, [_red, _green, 0, 1]];
drawLine3D [
ASLToAGL (_currentProjectileData select 0),
ASLToAGL (_nextProjectileData select 0),
[_red, _green, 0, 1]
];

} forEach _projectileData;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/diagnostic/fnc_projectileTracking_handleFired.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (_index <= (count GVAR(projectileData) - 1)) then {
};

// using 0.1 to improve performance, we don't need that many bullet position to draw a line
[FUNC(projectileTracking_trackProjectile), 0.1, [_projectile, _index, [(getPos _projectile), vectorMagnitude (velocity _projectile)]]] call CBA_fnc_addPerFrameHandler;
[FUNC(projectileTracking_trackProjectile), 0.1, [_projectile, _index, [getPosASL _projectile, vectorMagnitude velocity _projectile]]] call CBA_fnc_addPerFrameHandler;

private _maxLines = GVAR(projectileMaxLines) min 20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (!isNull _projectile) then {
_data = [_handle, _bulletData];
GVAR(projectileData) set [_index, _data];
};
_bulletData pushBack [(getPos _projectile), _speed];
_bulletData pushBack [getPosASL _projectile, _speed];

} else {
[_handle] call CBA_fnc_removePerFrameHandler;
Expand Down

0 comments on commit 92bf7f0

Please sign in to comment.