Locking player's viewangles
Posted: Thu Sep 15, 2011 11:08 am
I'm having a bit of an odd problem. I implemented cutscenes in my EntityPlus mod and while this works well, the only problem is that if the player moves the mouse during the cutscene (or presses the view up/down/left/right buttons) the view of the player after the cutscene will be affected by the mouse movement/button presses.
I want the player to be unable to alter its own view angles during the cutscene so that the view after the cutscene has ended is identical to the view before the cutscene. Locking player movement works already, it's just the view angles that won't seem to stick.
Anyone know how I can achieve this? Current source can be found here.
I already have this bit of code in PM_UpdateViewAngles in bg_pmove.c, but it doesn't seem to help anything:
During a cutscene, the player's pm_type is set to PM_CUTSCENE. This is how I tell if a player is currently in a cutscene or not.
I've also tried storing the player's viewangles in a temporary variable when the cutscene starts and then restore that when the cutscene has finished playing. This is done serverside (in the game project):
But this doesn't seem to help either.
Anyone know how I can stop the player from giving input that changes the view angles?
I want the player to be unable to alter its own view angles during the cutscene so that the view after the cutscene has ended is identical to the view before the cutscene. Locking player movement works already, it's just the view angles that won't seem to stick.
Anyone know how I can achieve this? Current source can be found here.
I already have this bit of code in PM_UpdateViewAngles in bg_pmove.c, but it doesn't seem to help anything:
Code: Select all
if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPINTERMISSION || ps->pm_type == PM_CUTSCENE ) {
return; // no view changes at all
}
I've also tried storing the player's viewangles in a temporary variable when the cutscene starts and then restore that when the cutscene has finished playing. This is done serverside (in the game project):
Code: Select all
VectorCopy(self->activator->orgAngles, self->activator->client->ps.viewangles);
Anyone know how I can stop the player from giving input that changes the view angles?