Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Projectile Tracking Heights #1445

Merged
merged 1 commit into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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