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

Spectator - Fix BIS_fnc_lerp causing crash in 3rd person spectator #5844

Merged
merged 2 commits into from
Dec 3, 2017

Conversation

PabstMirror
Copy link
Contributor

Using 3rd person follow in spectator caused hard game crash.
It pushed camera out to infinity

TRACE: 9649 pre1: _zoom=1, _zoomTemp=-3.48678e+009 z\ace\addons\spectator\functions\fnc_cam_prepareTarget.sqf:28
TRACE: 9649 pre2: ace_spectator_camDistance=1, ace_spectator_camDistanceTemp=-3.48678e+009 z\ace\addons\spectator\functions\fnc_cam_prepareTarget.sqf:29
TRACE: 9649 new: ace_spectator_camDeltaTime=0.171005, _zoomTemp=3.13811e+010 z\ace\addons\spectator\functions\fnc_cam_prepareTarget.sqf:34
TRACE: 9649 x: _bbd=[1.6,2.2,2], _distance=3.13811e+010 z\ace\addons\spectator\functions\fnc_cam_prepareTarget.sqf:40

1.78 changed BIS_fnc_lerp, both files still exist but the one that gets used has changed.

Current (a3\functions_f\animation\interp)

params [["_a", 0.0, [0.0]], ["_b", 0.0, [0.0]], ["_alpha", 0.0, [0.0]]];

_a + _alpha * (_b - _a);

Prior (a3\functions_f_exp_a\math)

params [["_a", 0.0, [0.0]], ["_b", 0.0, [0.0]], ["_speed", 1.0, [0.0]], ["_deltaTime", 0.0, [0.0]]];

private "_result";
_result = 0.0;

if (_a != _b) then
{
    _result = (_a * (1.0 - _deltaTime * _speed)) + (_b * _deltaTime * _speed);
};

_result;

@PabstMirror PabstMirror added this to the 3.12.0 milestone Dec 2, 2017
@kymckay
Copy link
Member

kymckay commented Dec 2, 2017

Good find and fix, I'd say we may as well just make the code inline and remove the call altogether

@kymckay kymckay merged commit 82aa953 into master Dec 3, 2017
@kymckay kymckay deleted the lerpDerp branch December 3, 2017 16:10
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* Fix BIS_fnc_lerp causing crash in 3rd person spectator
* Clarify spectator 3PP camera distance code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants