mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: server: fix restoring player view entity after save restore (fixes trigger_camera usage)
This commit is contained in:
@@ -307,7 +307,6 @@ static void SV_ConnectClient( netadr_t from )
|
||||
{
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
char protinfo[MAX_INFO_STRING];
|
||||
char physinfo[MAX_INFO_STRING];
|
||||
client_frame_t *frames;
|
||||
sv_client_t *newcl = NULL;
|
||||
int qport, version;
|
||||
@@ -416,12 +415,20 @@ static void SV_ConnectClient( netadr_t from )
|
||||
frames = Mem_Realloc( host.mempool, newcl->frames, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
||||
memset( frames, 0, sizeof( client_frame_t ) * SV_UPDATE_BACKUP );
|
||||
SV_ClearResourceLists( newcl );
|
||||
memcpy( physinfo, newcl->physinfo, sizeof( physinfo ));
|
||||
|
||||
memset( newcl, 0, sizeof( *newcl ));
|
||||
// a1ba: preserve physinfo and viewent as it's set by game logic before client connect!
|
||||
{
|
||||
char physinfo[MAX_INFO_STRING];
|
||||
edict_t *viewent = newcl->pViewEntity;
|
||||
|
||||
memcpy( physinfo, newcl->physinfo, sizeof( physinfo ));
|
||||
|
||||
memset( newcl, 0, sizeof( *newcl ));
|
||||
|
||||
memcpy( newcl->physinfo, physinfo, sizeof( newcl->physinfo ));
|
||||
newcl->pViewEntity = viewent;
|
||||
}
|
||||
|
||||
// a1ba: preserve physinfo as it's set by game logic, before client connect!
|
||||
memcpy( newcl->physinfo, physinfo, sizeof( newcl->physinfo ));
|
||||
newcl->edict = EDICT_NUM(( newcl - svs.clients ) + 1 );
|
||||
newcl->frames = frames;
|
||||
newcl->userid = g_userid++; // create unique userid
|
||||
|
||||
Reference in New Issue
Block a user