Client: Make sure we're respecting .viewzoom of a target that we spectate in first-person.

This commit is contained in:
Marco Cawthorne 2022-06-09 16:46:28 -07:00
parent 7560bc12b8
commit 24c869d9aa
Signed by: eukara
GPG key ID: CE2032F0A2882A22
4 changed files with 10 additions and 0 deletions

View file

@ -263,10 +263,17 @@ CSQC_UpdateView(float w, float h, float focus)
spec = (NSClientSpectator)self;
if (spec.spec_mode == SPECMODE_FIRSTPERSON || spec.spec_mode == SPECMODE_THIRDPERSON) {
NSClientPlayer spec_target;
c = findfloat(world, ::entnum, spec.spec_ent);
spec_target = (NSClientPlayer)c;
pSeat->m_vecPredictedOrigin = c.origin;
pSeat->m_vecPredictedVelocity = c.velocity;
pSeat->m_flPredictedFlags = c.flags;
if (spec.spec_mode == SPECMODE_FIRSTPERSON)
setproperty(VF_AFOV, cvar("fov") * spec_target.viewzoom);
else
setproperty(VF_AFOV, cvar("fov"));
} else {
pSeat->m_vecPredictedOrigin = spec.origin;
pSeat->m_vecPredictedVelocity = spec.velocity;

View file

@ -85,6 +85,7 @@ NSClient::predraw(void)
void
NSClient::NSClient(void)
{
flags |= FL_CLIENT;
XR_Init(this);
}

View file

@ -980,5 +980,6 @@ NSClientPlayer::InputUse_Up(void)
void
NSClientPlayer::NSClientPlayer(void)
{
flags |= FL_CLIENT;
vehicle = __NULL__;
}

View file

@ -450,6 +450,7 @@ NSClientSpectator::PostFrame(void)
void
NSClientSpectator::NSClientSpectator(void)
{
flags |= FL_CLIENT;
}
#ifdef CLIENT