mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Merge pull request #313 from LJSonik/analog-flipcam-synch-fix
Fix desynch when toggling analog mode or flipcam
This commit is contained in:
commit
a4f8411ae7
4 changed files with 4 additions and 36 deletions
|
@ -3094,12 +3094,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
displayplayer = newplayernum;
|
displayplayer = newplayernum;
|
||||||
secondarydisplayplayer = newplayernum;
|
secondarydisplayplayer = newplayernum;
|
||||||
DEBFILE("spawning me\n");
|
DEBFILE("spawning me\n");
|
||||||
// Apply player flags as soon as possible!
|
|
||||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
|
|
||||||
if (cv_flipcam.value)
|
|
||||||
players[newplayernum].pflags |= PF_FLIPCAM;
|
|
||||||
if (cv_analog.value)
|
|
||||||
players[newplayernum].pflags |= PF_ANALOGMODE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3107,12 +3101,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
DEBFILE("spawning my brother\n");
|
DEBFILE("spawning my brother\n");
|
||||||
if (botingame)
|
if (botingame)
|
||||||
players[newplayernum].bot = 1;
|
players[newplayernum].bot = 1;
|
||||||
// Same goes for player 2 when relevant
|
|
||||||
players[newplayernum].pflags &= ~(PF_FLIPCAM|PF_ANALOGMODE);
|
|
||||||
if (cv_flipcam2.value)
|
|
||||||
players[newplayernum].pflags |= PF_FLIPCAM;
|
|
||||||
if (cv_analog2.value)
|
|
||||||
players[newplayernum].pflags |= PF_ANALOGMODE;
|
|
||||||
}
|
}
|
||||||
D_SendPlayerConfig();
|
D_SendPlayerConfig();
|
||||||
addedtogame = true;
|
addedtogame = true;
|
||||||
|
|
|
@ -1363,9 +1363,9 @@ void SendWeaponPref(void)
|
||||||
XBOXSTATIC UINT8 buf[1];
|
XBOXSTATIC UINT8 buf[1];
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
if (players[consoleplayer].pflags & PF_FLIPCAM)
|
if (cv_flipcam.value)
|
||||||
buf[0] |= 1;
|
buf[0] |= 1;
|
||||||
if (players[consoleplayer].pflags & PF_ANALOGMODE)
|
if (cv_analog.value)
|
||||||
buf[0] |= 2;
|
buf[0] |= 2;
|
||||||
SendNetXCmd(XD_WEAPONPREF, buf, 1);
|
SendNetXCmd(XD_WEAPONPREF, buf, 1);
|
||||||
}
|
}
|
||||||
|
@ -1375,9 +1375,9 @@ void SendWeaponPref2(void)
|
||||||
XBOXSTATIC UINT8 buf[1];
|
XBOXSTATIC UINT8 buf[1];
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
if (players[secondarydisplayplayer].pflags & PF_FLIPCAM)
|
if (cv_flipcam2.value)
|
||||||
buf[0] |= 1;
|
buf[0] |= 1;
|
||||||
if (players[secondarydisplayplayer].pflags & PF_ANALOGMODE)
|
if (cv_analog2.value)
|
||||||
buf[0] |= 2;
|
buf[0] |= 2;
|
||||||
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
|
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
|
||||||
}
|
}
|
||||||
|
|
10
src/g_game.c
10
src/g_game.c
|
@ -1575,11 +1575,6 @@ static void Analog_OnChange(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cv_analog.value)
|
|
||||||
players[consoleplayer].pflags |= PF_ANALOGMODE;
|
|
||||||
else
|
|
||||||
players[consoleplayer].pflags &= ~PF_ANALOGMODE;
|
|
||||||
|
|
||||||
SendWeaponPref();
|
SendWeaponPref();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1600,11 +1595,6 @@ static void Analog2_OnChange(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cv_analog2.value)
|
|
||||||
players[secondarydisplayplayer].pflags |= PF_ANALOGMODE;
|
|
||||||
else
|
|
||||||
players[secondarydisplayplayer].pflags &= ~PF_ANALOGMODE;
|
|
||||||
|
|
||||||
SendWeaponPref2();
|
SendWeaponPref2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
src/r_main.c
10
src/r_main.c
|
@ -221,21 +221,11 @@ static void ChaseCam2_OnChange(void)
|
||||||
|
|
||||||
static void FlipCam_OnChange(void)
|
static void FlipCam_OnChange(void)
|
||||||
{
|
{
|
||||||
if (cv_flipcam.value)
|
|
||||||
players[consoleplayer].pflags |= PF_FLIPCAM;
|
|
||||||
else
|
|
||||||
players[consoleplayer].pflags &= ~PF_FLIPCAM;
|
|
||||||
|
|
||||||
SendWeaponPref();
|
SendWeaponPref();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FlipCam2_OnChange(void)
|
static void FlipCam2_OnChange(void)
|
||||||
{
|
{
|
||||||
if (cv_flipcam2.value)
|
|
||||||
players[secondarydisplayplayer].pflags |= PF_FLIPCAM;
|
|
||||||
else
|
|
||||||
players[secondarydisplayplayer].pflags &= ~PF_FLIPCAM;
|
|
||||||
|
|
||||||
SendWeaponPref2();
|
SendWeaponPref2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue