| Quake Style - Quake 3
Tutorials Freeze Tag - Freeze Tag Part 2 Making noclip work for dead players. |
if ( ps->pm_type == PM_INTERMISSION ) {
return; // no view changes at all
}
//freeze
if ( ps->pm_type == PM_NOCLIP ) {
} else {
//freeze
if ( ps->pm_type != PM_SPECTATOR && ps->stats[STAT_HEALTH] <= 0 ) {
return; // no view changes at all
}
//freeze
}
//freeze
// circularly clamp the angles with deltas
for (i=0 ; i<3 ; i++) {
cg.clientFrame++;
// update cg.predictedPlayerState
CG_PredictPlayerState();
//freeze
if ( cg.snap->ps.pm_type == PM_NOCLIP ) {
cg.renderingThirdPerson = qfalse;
} else {
//freeze
// decide on third person view
cg.renderingThirdPerson = cg_thirdPerson.integer || (cg.snap->ps.stats[STAT_HEALTH] <= 0);
//freeze
}
//freeze
// build cg.refdef
inwater = CG_CalcViewValues();
origin = cg.refdef.vieworg;
angles = cg.refdefViewAngles;
//freeze
if ( cg.snap->ps.pm_type == PM_NOCLIP ) {
} else {
//freeze
// if dead, fix the angle and don't add any kick
if ( cg.snap->ps.stats[STAT_HEALTH] <= 0 ) {
angles[ROLL] = 40;
angles[PITCH] = -15;
angles[YAW] = cg.snap->ps.stats[STAT_DEAD_YAW];
origin[2] += cg.predictedPlayerState.viewheight;
return;
}
//freeze
}
//freeze
// add angles based on weapon kick
if ( pm->ps->pm_type >= PM_DEAD ) {
pm->cmd.forwardmove = 0;
pm->cmd.rightmove = 0;
pm->cmd.upmove = 0;
}
if ( pm->ps->pm_type == PM_SPECTATOR ) {
PM_CheckDuck ();
PM_FlyMove ();
PM_DropTimers ();
return;
}
if ( pm->ps->pm_type == PM_NOCLIP ) {
/*freeze
PM_NoclipMove ();
freeze*/
if ( pm->ps->pm_time ) {
PM_DeadMove();
} else {
PM_CheckDuck();
PM_FlyMove();
}
pm->ps->weapon = WP_NONE;
//freeze
PM_DropTimers ();
return;
}
if (pm->ps->pm_type == PM_FREEZE) {
return; // no movement at all
}
// apply flying friction
if ( pm->ps->powerups[PW_FLIGHT] || pm->ps->pm_type == PM_SPECTATOR ) {
drop += speed*pm_flightfriction*pml.frametime;
}
//freeze
if ( pm->ps->pm_type == PM_NOCLIP ) {
drop += speed * pm_flightfriction * pml.frametime;
}
//freeze
// scale the velocity
newspeed = speed - drop;
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_SPECTATOR ) {
CG_DrawSpectator();
CG_DrawCrosshair();
CG_DrawCrosshairNames();
} else {
// don't draw any status if dead
if ( cg.snap->ps.stats[STAT_HEALTH] > 0 ) {
CG_DrawStatusBar();
CG_DrawAmmoWarning();
CG_DrawCrosshair();
CG_DrawCrosshairNames();
CG_DrawWeaponSelect();
CG_DrawHoldableItem();
CG_DrawReward();
}
if ( cgs.gametype >= GT_TEAM ) {
CG_DrawTeamInfo();
}
//freeze
if ( cg.snap->ps.pm_type == PM_NOCLIP ) {
CG_DrawSpectator();
CG_DrawCrosshairNames();
}
//freeze
}
//freeze
if ( cg.snap->ps.pm_type == PM_NOCLIP ) {
if ( cg.predictedPlayerState.powerups[ PW_BALL ] ) {
CG_DrawBigString( 320 - 8 * 8, 24, "freezing", 1.0F );
}
return;
}
//freeze
CG_DrawBigString(320 - 9 * 8, 440, "SPECTATOR", 1.0F);
if ( cgs.gametype == GT_TOURNAMENT ) {
CG_DrawBigString(320 - 15 * 8, 460, "waiting to play", 1.0F);
CG_Trace( &trace, start, vec3_origin, vec3_origin, end,
cg.snap->ps.clientNum, CONTENTS_SOLID|CONTENTS_BODY );
if ( trace.entityNum >= MAX_CLIENTS ) {
//freeze
entityState_t *es;
es = &cg_entities[ trace.entityNum ].currentState;
// If this body's frozen and the player who "made" this body is frozen then show that player's name
if ( es->powerups & ( 1 << PW_BALL ) && cg_entities[ es->otherEntityNum ].currentState.powerups & ( 1 << PW_BALL ) ) {
cg.crosshairClientNum = es->otherEntityNum;
cg.crosshairClientTime = cg.time;
}
//freeze
return;
}