Skip to content

Commit

Permalink
engine: client: silently ignore if server didn't sent local player in…
Browse files Browse the repository at this point in the history
…fo in delta at spawn

The bug happens somewhere in server, not sure where or how. Remove Host_Error so mods
can be played again.
  • Loading branch information
a1batross committed Feb 26, 2024
1 parent abbe993 commit a508467
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions engine/client/cl_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,25 +795,14 @@ static void CL_SetupPMove( playermove_t *pmove, const local_state_t *from, const

pmove->player_index = ps->number - 1;

// a1ba: workaround bug on old protocol where the server refuse to send
// our local player in delta. cl.playernum, in theory, must be equal
// to our local player index anyway
// a1ba: workaround bug where the server refuse to send our local player in delta
// cl.playernum, in theory, must be equal to our local player index anyway
//
// this might not be a real solution, since everything else will be bogus
// but we need to properly run prediction and avoid potential memory
// corruption
// either debug this, or remove when old protocol will be dropped!!!
if( pmove->player_index < 0 )
{
if( cls.legacymode )
{
pmove->player_index = bound( 0, cl.playernum, cl.maxclients - 1 );
}
else
{
// if this happens, record a demo and send it to a1ba
Host_Error( "%s: ps->number == %d\n", __func__, ps->number );
}
}
pmove->player_index = bound( 0, cl.playernum, cl.maxclients - 1 );

pmove->multiplayer = (cl.maxclients > 1);
pmove->runfuncs = runfuncs;
Expand Down

0 comments on commit a508467

Please sign in to comment.