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

Client event angles are wrong when using trigger_camera #1744

Open
SamVanheer opened this issue Aug 27, 2016 · 1 comment
Open

Client event angles are wrong when using trigger_camera #1744

SamVanheer opened this issue Aug 27, 2016 · 1 comment

Comments

@SamVanheer
Copy link

SamVanheer commented Aug 27, 2016

The client's event angles are wrong when using trigger_camera/pfnSetView. Instead of using the client's aim angles, it uses their current view angles, which are overridden when using trigger_camera, or when using g_engfuncs::pfnSetView for other purposes.

The result of this is that any effects that rely on angles such as the Gauss gun's beams are emitted in the wrong direction.

The cause of this is that the wrong angles are copied over in the client's local version of the event. Other players seem to be getting the player's angles as they should.

The cause can be found here:

ang = v_angles;

v_angles is the latest refdef call's state, copied from ref_params_t::viewangles. Using viewangles::cl_viewangles works here.

These are the changes needed to make this work:
After this line:

extern vec3_t v_angles;

Add this

extern vec3_t v_client_aimangles;

Modify this line:

ang = v_angles;

To this:

ang			= v_client_aimangles;

After this line:

vec3_t ev_punchangle;

Add this:

vec3_t v_client_aimangles;

After this line:

v_angles = pparams->viewangles;

Add this:

v_client_aimangles = pparams->cl_viewangles;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants