/* ================== CG_SetInitialSnapshot This will only happen on the very first snapshot, or on tourney restarts. All other times will use CG_TransitionSnapshot instead. FIXME: Also called by map_restart? ================== */ void CG_SetInitialSnapshot(snapshot_t *snap) { int i; centity_t *cent; entityState_t *state; char buff[16]; cg.snap = snap; // trap_S_ClearSounds( qtrue ); BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].currentState, cg.time, qfalse); // sort out solid entities CG_BuildSolidList(); CG_ExecuteNewServerCommands(snap->serverCommandSequence); // set our local weapon selection pointer to // what the server has indicated the current weapon is CG_Respawn(qfalse); for (i = 0 ; i < cg.snap->numEntities ; i++) { state = &cg.snap->entities[i]; cent = &cg_entities[state->number]; memcpy(¢->currentState, state, sizeof(entityState_t)); //cent->currentState = *state; cent->interpolate = qfalse; cent->currentValid = qtrue; CG_ResetEntity(cent); // check for events CG_CheckEvents(cent); } trap_Cvar_VariableStringBuffer("r_oldMode", buff, sizeof(buff)); if (atoi(buff)) { // confirmation screen trap_UI_Popup(UIMENU_INGAME); } else if (cg.demoPlayback) { ccInitial = qtrue; } else { static char prevmap[64] = { 0 }; char curmap[64]; trap_Cvar_VariableStringBuffer("mapname", curmap, 64); if (Q_stricmp(curmap, prevmap)) { strcpy(prevmap, curmap); if (cgs.campaignInfoLoaded) { if (!cg.showGameView) { CG_LimboMenu_f(); } /* } else { ccInitial = qtrue; // Start the Initial Camera if specified CG_StartInitialCamera(); */ } } } // remove motd window if (cg.motdWindow != NULL) { CG_windowFree(cg.motdWindow); cg.motdWindow = NULL; } // Activate alternate input handler during demo playback if (cg.demoPlayback) { CG_keyOn_f(); if (demo_infoWindow.integer > 0) { CG_ShowHelp_On(&cg.demohelpWindow); } } // update client XP for spectator frames if (cg.snap->ps.clientNum == cg.clientNum) // sanity check { int cXP = (32768 * cg.snap->ps.stats[STAT_XP_OVERFLOW]) + cg.snap->ps.stats[STAT_XP]; if (cg.xp < cXP) { cg.xpChangeTime = cg.time; } cg.xp = cXP; } }
/* ================== CG_SetInitialSnapshot This will only happen on the very first snapshot, or on tourney restarts. All other times will use CG_TransitionSnapshot instead. FIXME: Also called by map_restart? ================== */ void CG_SetInitialSnapshot( snapshot_t *snap ) { int i; centity_t *cent; entityState_t *state; char buff[16]; cg.snap = snap; // trap_S_ClearSounds( qtrue ); BG_PlayerStateToEntityState( &snap->ps, &cg_entities[ snap->ps.clientNum ].currentState, qfalse ); // sort out solid entities CG_BuildSolidList(); CG_ExecuteNewServerCommands( snap->serverCommandSequence ); // set our local weapon selection pointer to // what the server has indicated the current weapon is CG_Respawn( qfalse ); for ( i = 0 ; i < cg.snap->numEntities ; i++ ) { state = &cg.snap->entities[ i ]; cent = &cg_entities[ state->number ]; memcpy(¢->currentState, state, sizeof(entityState_t)); //cent->currentState = *state; cent->interpolate = qfalse; cent->currentValid = qtrue; CG_ResetEntity( cent ); // check for events CG_CheckEvents( cent ); } cg_fxflags = 0; trap_Cvar_VariableStringBuffer( "r_oldMode", buff, sizeof(buff) ); if( atoi(buff) ) { // Arnout: confirmation screen trap_UI_Popup( UIMENU_INGAME ); } else if(cg.demoPlayback) { ccInitial = qtrue; } else { static char prevmap[64] = { 0 }; char curmap[64]; trap_Cvar_VariableStringBuffer( "mapname", curmap, 64 ); if ( Q_stricmp( curmap, prevmap ) ) { strcpy( prevmap, curmap ); if(cgs.campaignInfoLoaded) { if( !cg.showGameView ) { CG_LimboMenu_f(); } /* } else { ccInitial = qtrue; // Start the Initial Camera if specified CG_StartInitialCamera(); */ } } } // OSP - remove motd window if(cg.motdWindow != NULL) { CG_windowFree(cg.motdWindow); cg.motdWindow = NULL; } // Activate alternate input handler during demo playback if(cg.demoPlayback) { CG_keyOn_f(); if(demo_infoWindow.integer > 0) { CG_ShowHelp_On(&cg.demohelpWindow); } } // OSP #if __MACOS__ #ifdef GAMERANGER // LBO 12/13/04. Add support for GameRanger team voice IDs GRSetMyTeamID(cg.snap->ps.persistant[PERS_TEAM]); #endif #endif }
/* ================== CG_SetInitialSnapshot This will only happen on the very first snapshot, or on tourney restarts. All other times will use CG_TransitionSnapshot instead. ================== */ void CG_SetInitialSnapshot(snapshot_t *snap) { int i; centity_t *cent; char buff[16]; cg.snap = snap; BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].currentState, qfalse); // sort out solid entities CG_BuildSolidList(); CG_ExecuteNewServerCommands(snap->serverCommandSequence); // set our local weapon selection pointer to // what the server has indicated the current weapon is CG_Respawn(); for (i = 0 ; i < cg.snap->numEntities ; ++i) { entityState_t *state = &cg.snap->entities[i]; cent = &cg_entities[state->number]; memcpy(¢->currentState, state, sizeof (entityState_t)); cent->interpolate = qfalse; cent->currentValid = qtrue; CG_ResetEntity(cent); // check for events CG_CheckEvents(cent); } cg_fxflags = 0; trap_Cvar_VariableStringBuffer("r_oldMode", buff, sizeof (buff)); if (atoi(buff)) { // Arnout: confirmation screen trap_UI_Popup(UIMENU_INGAME); } else if (!cg.demoPlayback) { static char prevmap[64] = { 0 }; char curmap[64]; trap_Cvar_VariableStringBuffer("mapname", curmap, 64); if (Q_stricmp(curmap, prevmap)) { strcpy(prevmap, curmap); if (cgs.campaignInfoLoaded) { if (!cg.showGameView) { CG_LimboMenu_f(); } } } } // OSP - remove motd window if (cg.motdWindow != NULL) { CG_windowFree(cg.motdWindow); cg.motdWindow = NULL; } // Activate alternate input handler during demo playback if (cg.demoPlayback) { CG_keyOn_f(); if (demo_infoWindow.integer > 0) { CG_ShowHelp_On(&cg.demohelpWindow); } } }