G_AdjustViewEx and fix freecam reset if demo player spectates
based on 10c117f95f
This commit is contained in:
parent
c3dfa0b40e
commit
f4f3ff0fdb
4 changed files with 14 additions and 8 deletions
|
|
@ -2739,7 +2739,7 @@ void CL_RemovePlayer(INT32 playernum, kickreason_t reason)
|
|||
LUA_InvalidatePlayer(&players[playernum]);
|
||||
|
||||
// don't look through someone's view who isn't there
|
||||
G_ResetViews();
|
||||
G_ResetViews(false);
|
||||
|
||||
K_CheckBumpers();
|
||||
P_CheckRacers();
|
||||
|
|
|
|||
|
|
@ -1230,7 +1230,7 @@ void G_ReadDemoExtraData(void)
|
|||
break;
|
||||
}
|
||||
|
||||
G_ResetViews();
|
||||
G_ResetViews(false); // dont reset our freecam pls thx!
|
||||
|
||||
// maybe these are necessary?
|
||||
K_CheckBumpers();
|
||||
|
|
@ -2397,7 +2397,7 @@ void G_ConfirmRewind(tic_t rewindtime)
|
|||
displayplayers[2] = olddp3;
|
||||
displayplayers[3] = olddp4;
|
||||
R_ExecuteSetViewSize();
|
||||
G_ResetViews();
|
||||
G_ResetViews(true);
|
||||
|
||||
for (i = splitscreen; i >= 0; i--)
|
||||
P_ResetCamera(&players[displayplayers[i]], &camera[i]);
|
||||
|
|
|
|||
11
src/g_game.c
11
src/g_game.c
|
|
@ -2316,11 +2316,16 @@ void G_FixCamera(UINT8 view)
|
|||
// Increment a viewpoint by offset from the current player. A negative value
|
||||
// decrements.
|
||||
//
|
||||
void G_AdjustView(UINT8 viewnum, INT32 offset, boolean onlyactive)
|
||||
void G_AdjustViewEx(UINT8 viewnum, INT32 offset, boolean onlyactive, boolean resetfreecam)
|
||||
{
|
||||
INT32 *displayplayerp, oldview;
|
||||
displayplayerp = &displayplayers[viewnum-1];
|
||||
oldview = (*displayplayerp);
|
||||
|
||||
// turn off the freecam
|
||||
if (resetfreecam)
|
||||
camera[viewnum-1].freecam = false;
|
||||
|
||||
G_ResetView(viewnum, ( (*displayplayerp) + offset ), onlyactive);
|
||||
|
||||
// If no other view could be found, go back to what we had.
|
||||
|
|
@ -2333,7 +2338,7 @@ void G_AdjustView(UINT8 viewnum, INT32 offset, boolean onlyactive)
|
|||
// Ensures all viewpoints are valid
|
||||
// Also demotes splitscreen down to one player.
|
||||
//
|
||||
void G_ResetViews(void)
|
||||
void G_ResetViews(boolean resetfreecam)
|
||||
{
|
||||
UINT8 splits;
|
||||
UINT8 viewd;
|
||||
|
|
@ -2357,7 +2362,7 @@ void G_ResetViews(void)
|
|||
*/
|
||||
for (viewd = 1; viewd <= splits; ++viewd)
|
||||
{
|
||||
G_AdjustView(viewd, 0, false);
|
||||
G_AdjustViewEx(viewd, 0, false, resetfreecam);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,9 +226,10 @@ INT32 G_FindView(INT32 startview, UINT8 viewnum, boolean onlyactive, boolean rev
|
|||
INT32 G_CountPlayersPotentiallyViewable(boolean active);
|
||||
|
||||
void G_FixCamera(UINT8 view);
|
||||
void G_ResetViews(void);
|
||||
void G_ResetViews(boolean resetfreecam);
|
||||
void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive);
|
||||
void G_AdjustView(UINT8 viewnum, INT32 offset, boolean onlyactive);
|
||||
void G_AdjustViewEx(UINT8 viewnum, INT32 offset, boolean onlyactive, boolean resetfreecam);
|
||||
#define G_AdjustView(v,o,oa) G_AdjustViewEx(v,o,oa, true)
|
||||
|
||||
void G_AddPlayer(INT32 playernum, INT32 console);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue