- Duke: Change a few ps[] to use the p alias available following changes in f4fff5ee30.

This commit is contained in:
Mitchell Richters 2020-09-25 00:09:31 +10:00
parent f0262039b6
commit 16cee1148b
5 changed files with 20 additions and 20 deletions

View file

@ -67,7 +67,7 @@ void hud_input(int snum)
i = p->aim_mode; i = p->aim_mode;
p->aim_mode = !PlayerInput(snum, SB_AIMMODE); p->aim_mode = !PlayerInput(snum, SB_AIMMODE);
if (p->aim_mode < i) if (p->aim_mode < i)
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
// Backup weapon here as hud_input() is the first function where any one of the weapon variables can change. // Backup weapon here as hud_input() is the first function where any one of the weapon variables can change.
backupweapon(p); backupweapon(p);
@ -483,7 +483,7 @@ void hud_input(int snum)
OnEvent(EVENT_TURNAROUND, -1, snum, -1); OnEvent(EVENT_TURNAROUND, -1, snum, -1);
if (GetGameVarID(g_iReturnVarID, -1, snum) != 0) if (GetGameVarID(g_iReturnVarID, -1, snum) != 0)
{ {
ps[snum].sync.actions &= ~SB_TURNAROUND; p->sync.actions &= ~SB_TURNAROUND;
} }
} }
} }
@ -963,7 +963,7 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
loc.q16avel = input.q16avel = 0; loc.q16avel = input.q16avel = 0;
} }
if (p->newowner == -1 && !(ps[playerNum].sync.actions & SB_CENTERVIEW)) if (p->newowner == -1 && !(p->sync.actions & SB_CENTERVIEW))
{ {
loc.q16horz = clamp(loc.q16horz + input.q16horz, IntToFixed(-MAXHORIZVEL), IntToFixed(MAXHORIZVEL)); loc.q16horz = clamp(loc.q16horz + input.q16horz, IntToFixed(-MAXHORIZVEL), IntToFixed(MAXHORIZVEL));
} }
@ -1025,8 +1025,8 @@ static void GetInputInternal(InputPacket &locInput, ControlInfo* const hidInput)
// Do these in the same order as the old code. // Do these in the same order as the old code.
calcviewpitch(p, scaleAdjust); calcviewpitch(p, scaleAdjust);
processq16avel(p, &input.q16avel); processq16avel(p, &input.q16avel);
applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, input.q16avel, &ps[myconnectindex].sync.actions, scaleAdjust, p->crouch_toggle || ps[myconnectindex].sync.actions & SB_CROUCH); applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, input.q16avel, &p->sync.actions, scaleAdjust, p->crouch_toggle || p->sync.actions & SB_CROUCH);
sethorizon(&p->q16horiz, input.q16horz, &ps[myconnectindex].sync.actions, scaleAdjust); sethorizon(&p->q16horiz, input.q16horz, &p->sync.actions, scaleAdjust);
} }
playerProcessHelpers(&p->q16ang, &p->angAdjust, &p->angTarget, &p->q16horiz, &p->horizAdjust, &p->horizTarget, scaleAdjust); playerProcessHelpers(&p->q16ang, &p->angAdjust, &p->angTarget, &p->q16horiz, &p->horizAdjust, &p->horizTarget, scaleAdjust);

View file

@ -165,7 +165,7 @@ void forceplayerangle(int snum)
n = 128 - (krand() & 255); n = 128 - (krand() & 255);
playerAddHoriz(&p->q16horiz, &p->horizAdjust, 64); playerAddHoriz(&p->q16horiz, &p->horizAdjust, 64);
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
p->setlookang(n >> 1); p->setlookang(n >> 1);
p->setrotscrnang(n >> 1); p->setrotscrnang(n >> 1);
} }
@ -407,7 +407,7 @@ void dokneeattack(int snum, int pi, const std::initializer_list<int> & respawnli
{ {
p->knee_incs++; p->knee_incs++;
playerAddHoriz(&p->q16horiz, &p->horizAdjust, -48); playerAddHoriz(&p->q16horiz, &p->horizAdjust, -48);
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
if (p->knee_incs > 15) if (p->knee_incs > 15)
{ {
p->knee_incs = 0; p->knee_incs = 0;
@ -961,11 +961,11 @@ void playerCenterView(int snum)
OnEvent(EVENT_RETURNTOCENTER, p->i, snum, -1); OnEvent(EVENT_RETURNTOCENTER, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0) if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0)
{ {
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
} }
else else
{ {
ps[snum].sync.actions &= ~SB_CENTERVIEW; p->sync.actions &= ~SB_CENTERVIEW;
} }
} }
@ -976,11 +976,11 @@ void playerLookUp(int snum, ESyncBits actions)
OnEvent(EVENT_LOOKUP, p->i, snum, -1); OnEvent(EVENT_LOOKUP, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0) if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0)
{ {
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
} }
else else
{ {
ps[snum].sync.actions &= ~SB_LOOK_UP; p->sync.actions &= ~SB_LOOK_UP;
} }
} }
@ -991,11 +991,11 @@ void playerLookDown(int snum, ESyncBits actions)
OnEvent(EVENT_LOOKDOWN, p->i, snum, -1); OnEvent(EVENT_LOOKDOWN, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0) if (GetGameVarID(g_iReturnVarID, p->i, snum) == 0)
{ {
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
} }
else else
{ {
ps[snum].sync.actions &= ~SB_LOOK_DOWN; p->sync.actions &= ~SB_LOOK_DOWN;
} }
} }
@ -1006,7 +1006,7 @@ void playerAimUp(int snum, ESyncBits actions)
OnEvent(EVENT_AIMUP, p->i, snum, -1); OnEvent(EVENT_AIMUP, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, p->i, snum) != 0) if (GetGameVarID(g_iReturnVarID, p->i, snum) != 0)
{ {
ps[snum].sync.actions &= ~SB_AIM_UP; p->sync.actions &= ~SB_AIM_UP;
} }
} }
@ -1017,7 +1017,7 @@ void playerAimDown(int snum, ESyncBits actions)
OnEvent(EVENT_AIMDOWN, p->i, snum, -1); OnEvent(EVENT_AIMDOWN, p->i, snum, -1);
if (GetGameVarID(g_iReturnVarID, p->i, snum) != 0) if (GetGameVarID(g_iReturnVarID, p->i, snum) != 0)
{ {
ps[snum].sync.actions &= ~SB_AIM_DOWN; p->sync.actions &= ~SB_AIM_DOWN;
} }
} }

View file

@ -2840,7 +2840,7 @@ void processinput_d(int snum)
// may still be needed later for demo recording // may still be needed later for demo recording
processq16avel(p, &sb_avel); processq16avel(p, &sb_avel);
applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, sb_avel, &ps[snum].sync.actions, 1, p->crouch_toggle || actions & SB_CROUCH); applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, sb_avel, &p->sync.actions, 1, p->crouch_toggle || actions & SB_CROUCH);
} }
if (p->spritebridge == 0) if (p->spritebridge == 0)
@ -3072,7 +3072,7 @@ HORIZONLY:
if (cl_syncinput) if (cl_syncinput)
{ {
sethorizon(&p->q16horiz, PlayerHorizon(snum), &ps[snum].sync.actions, 1); sethorizon(&p->q16horiz, PlayerHorizon(snum), &p->sync.actions, 1);
} }
checkhardlanding(p); checkhardlanding(p);

View file

@ -3741,7 +3741,7 @@ void processinput_r(int snum)
// may still be needed later for demo recording // may still be needed later for demo recording
processq16avel(p, &sb_avel); processq16avel(p, &sb_avel);
applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, sb_avel, &ps[snum].sync.actions, 1, p->crouch_toggle || actions & SB_CROUCH); applylook(&p->q16ang, &p->q16look_ang, &p->q16rotscrnang, &p->one_eighty_count, sb_avel, &p->sync.actions, 1, p->crouch_toggle || actions & SB_CROUCH);
apply_seasick(p, 1); apply_seasick(p, 1);
} }
@ -4097,7 +4097,7 @@ HORIZONLY:
if (cl_syncinput) if (cl_syncinput)
{ {
sethorizon(&p->q16horiz, PlayerHorizon(snum), &ps[snum].sync.actions, 1); sethorizon(&p->q16horiz, PlayerHorizon(snum), &p->sync.actions, 1);
} }
checkhardlanding(p); checkhardlanding(p);

View file

@ -119,7 +119,7 @@ void resetplayerstats(int snum)
p->bobcounter = 0; p->bobcounter = 0;
p->on_ground = 0; p->on_ground = 0;
p->player_par = 0; p->player_par = 0;
ps[snum].sync.actions |= SB_CENTERVIEW; p->sync.actions |= SB_CENTERVIEW;
p->airleft = 15*26; p->airleft = 15*26;
p->rapid_fire_hold = 0; p->rapid_fire_hold = 0;
p->toggle_key_flag = 0; p->toggle_key_flag = 0;