2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-29 13:30:34 +01:00

engine: client: silently ignore if server didn't sent local player info in delta at spawn

The bug happens somewhere in server, not sure where or how. Remove Host_Error so mods
can be played again.
This commit is contained in:
Alibek Omarov 2024-02-26 11:48:42 +03:00
parent abbe993e80
commit a508467aac

View File

@ -795,25 +795,14 @@ static void CL_SetupPMove( playermove_t *pmove, const local_state_t *from, const
pmove->player_index = ps->number - 1; pmove->player_index = ps->number - 1;
// a1ba: workaround bug on old protocol where the server refuse to send // a1ba: workaround bug where the server refuse to send our local player in delta
// our local player in delta. cl.playernum, in theory, must be equal // cl.playernum, in theory, must be equal to our local player index anyway
// to our local player index anyway //
// this might not be a real solution, since everything else will be bogus // this might not be a real solution, since everything else will be bogus
// but we need to properly run prediction and avoid potential memory // but we need to properly run prediction and avoid potential memory
// corruption // corruption
// either debug this, or remove when old protocol will be dropped!!!
if( pmove->player_index < 0 ) if( pmove->player_index < 0 )
{ pmove->player_index = bound( 0, cl.playernum, cl.maxclients - 1 );
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->multiplayer = (cl.maxclients > 1); pmove->multiplayer = (cl.maxclients > 1);
pmove->runfuncs = runfuncs; pmove->runfuncs = runfuncs;