diff --git a/reaction/cgame/cg_players.c b/reaction/cgame/cg_players.c index b21e7817..b4e1ebb1 100644 --- a/reaction/cgame/cg_players.c +++ b/reaction/cgame/cg_players.c @@ -2671,6 +2671,9 @@ void CG_Player(centity_t * cent) { memcpy(cg.headAxis, head.axis, sizeof(head.axis)); memcpy(cg.headPos, head.origin, sizeof(head.origin)); + cg.headPos[2] += 16; + if (cg.snap->ps.stats[STAT_HEALTH] > 0) + memcpy(cg.oldHeadPos, cg.headPos, sizeof(cg.headPos)); } head.shadowPlane = shadowPlane; diff --git a/reaction/cgame/cg_view.c b/reaction/cgame/cg_view.c index cba2a32f..0f263b1a 100644 --- a/reaction/cgame/cg_view.c +++ b/reaction/cgame/cg_view.c @@ -442,23 +442,21 @@ void CG_PositionRotatedEntityOnTag(refEntity_t * entity, const refEntity_t * par */ static void CG_DeadPlayerView() { - if (cg.renderingThirdPerson) + if (cg.renderingThirdPerson || 0 != (cg.snap->ps.eFlags & EF_HEADLESS)) { cg.refdefViewAngles[ROLL] = 40; cg.refdefViewAngles[PITCH] = -15; cg.refdefViewAngles[YAW] = cg.snap->ps.stats[STAT_DEAD_YAW]; cg.refdef.vieworg[2] += cg.predictedPlayerState.viewheight; } else { - vec3_t dir; trace_t tr; + memcpy(cg.refdef.vieworg, cg.headPos, sizeof(cg.headPos)); memcpy(cg.refdef.viewaxis, cg.headAxis, sizeof(cg.headAxis)); - cg.refdef.vieworg[2] += 16; - VectorSubtract(cg.refdef.vieworg, cg.oldHeadPos, dir); CG_Trace(&tr, cg.oldHeadPos, NULL, NULL, cg.refdef.vieworg, cg.clientNum, CONTENTS_SOLID); VectorCopy(tr.endpos, cg.refdef.vieworg); - VectorCopy(cg.refdef.vieworg, cg.oldHeadPos); + VectorCopy(cg.headPos, cg.oldHeadPos); } }