/* ================ SpectatorThink Called every frame after physics are run ================ */ void CBaseSpectator::SpectatorThink() { if(!(pev->flags & FL_SPECTATOR)) pev->flags = FL_SPECTATOR; pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NOCLIP; if(pev->impulse) SpectatorImpulseCommand(); };
/* ================ SpectatorThink Called every frame after physics are run ================ */ void CBaseSpectator::SpectatorThink(void) { if (!(pev->flags & FL_SPECTATOR)) { pev->flags |= (FL_SPECTATOR | FL_PROXY); } pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NOCLIP; if (pev->impulse) SpectatorImpulseCommand(); }
//////////////// // GlobalParams: // time // self /////////////// void SpectatorThink() { gedict_t *wizard = self->wizard; if ( self->last_goal != self->s.v.goalentity ) { SpecGoalChanged(); self->last_goal = self->s.v.goalentity; } if ( self->autotrack ) DoAutoTrack(); if ( self->s.v.impulse ) SpectatorImpulseCommand(); if ( self->sc_stats && self->sc_stats_time && self->sc_stats_time <= g_globalvars.time && match_in_progress != 1 ) Print_Scores (); if ( self->wp_stats && self->wp_stats_time && self->wp_stats_time <= g_globalvars.time && match_in_progress != 1 ) Print_Wp_Stats (); if ( wizard ) { // set model angles wizard->s.v.angles[0] = -self->s.v.v_angle[0] / 2; wizard->s.v.angles[1] = self->s.v.v_angle[1]; // wizard model blinking at spectator screen - so move model behind spec camera a bit trap_makevectors( self->s.v.v_angle ); VectorMA (self->s.v.origin, -32, g_globalvars.v_forward, wizard->s.v.origin); // model bobbing wizard->s.v.origin[2] += sin( g_globalvars.time * 2.5 ); setorigin( wizard, PASSVEC3( wizard->s.v.origin ) ); if ( GetSpecWizard () ) { gedict_t *goal = PROG_TO_EDICT( self->s.v.goalentity ); if ( goal && goal->ct == ctPlayer ) // tracking player, so turn model off wizard->s.v.model = ""; else // turn model on setmodel( wizard, "progs/wizard.mdl" ); } else { wizard->s.v.model = ""; // turn model off } } }
//////////////// // GlobalParams: // time // self /////////////// void SpectatorThink() { if ( self->s.v.impulse ) SpectatorImpulseCommand(); }