mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 12:50:44 +00:00
Fix thrown items desyncing during frame advance
This commit is contained in:
parent
d6e77fc12e
commit
40d065a024
3 changed files with 31 additions and 3 deletions
10
src/g_game.c
10
src/g_game.c
|
@ -2407,6 +2407,7 @@ void G_Ticker(boolean run)
|
|||
|
||||
buf = gametic % BACKUPTICS;
|
||||
|
||||
if (!demo.playback)
|
||||
// read/write demo and check turbo cheat
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -2414,15 +2415,18 @@ void G_Ticker(boolean run)
|
|||
|
||||
if (playeringame[i])
|
||||
{
|
||||
//@TODO all this throwdir stuff shouldn't be here! But it stays for now to maintain 1.0.4 compat...
|
||||
// Remove for 1.1!
|
||||
|
||||
// SRB2kart
|
||||
// Save the dir the player is holding
|
||||
// to allow items to be thrown forward or backward.
|
||||
if (cmd->buttons & BT_FORWARD)
|
||||
players[i].kartstuff[k_throwdir] = 1;
|
||||
players[i].kartstuff[k_throwdir] = 1;
|
||||
else if (cmd->buttons & BT_BACKWARD)
|
||||
players[i].kartstuff[k_throwdir] = -1;
|
||||
players[i].kartstuff[k_throwdir] = -1;
|
||||
else
|
||||
players[i].kartstuff[k_throwdir] = 0;
|
||||
players[i].kartstuff[k_throwdir] = 0;
|
||||
|
||||
G_CopyTiccmd(cmd, &netcmds[buf][i], 1);
|
||||
|
||||
|
|
11
src/p_tick.c
11
src/p_tick.c
|
@ -628,7 +628,18 @@ void P_Ticker(boolean run)
|
|||
G_ReadDemoExtraData();
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
{
|
||||
//@TODO all this throwdir stuff shouldn't be here! But it's added to maintain 1.0.4 compat for now...
|
||||
// Remove for 1.1!
|
||||
if (players[i].cmd.buttons & BT_FORWARD)
|
||||
players[i].kartstuff[k_throwdir] = 1;
|
||||
else if (players[i].cmd.buttons & BT_BACKWARD)
|
||||
players[i].kartstuff[k_throwdir] = -1;
|
||||
else
|
||||
players[i].kartstuff[k_throwdir] = 0;
|
||||
|
||||
G_ReadDemoTiccmd(&players[i].cmd, i);
|
||||
}
|
||||
#ifdef DEMO_COMPAT_100
|
||||
}
|
||||
#endif
|
||||
|
|
13
src/p_user.c
13
src/p_user.c
|
@ -8779,6 +8779,19 @@ void P_PlayerThink(player_t *player)
|
|||
|
||||
cmd = &player->cmd;
|
||||
|
||||
//@TODO This fixes a one-tic latency on direction handling, AND makes behavior consistent while paused, but is not BC with 1.0.4. Do this for 1.1!
|
||||
#if 0
|
||||
// SRB2kart
|
||||
// Save the dir the player is holding
|
||||
// to allow items to be thrown forward or backward.
|
||||
if (cmd->buttons & BT_FORWARD)
|
||||
player->kartstuff[k_throwdir] = 1;
|
||||
else if (cmd->buttons & BT_BACKWARD)
|
||||
player->kartstuff[k_throwdir] = -1;
|
||||
else
|
||||
player->kartstuff[k_throwdir] = 0;
|
||||
#endif
|
||||
|
||||
// Add some extra randomization.
|
||||
if (cmd->forwardmove)
|
||||
P_RandomFixed();
|
||||
|
|
Loading…
Reference in a new issue