env_beam, env_laser, prop_rope: Use GetEyePos() to assign the proper player view position
This commit is contained in:
parent
fb4e08c2bf
commit
65f21af405
4 changed files with 22 additions and 4 deletions
|
@ -270,13 +270,13 @@ CSQC_UpdateView(float w, float h, float focus)
|
|||
pSeatLocal = &g_seatslocal[s];
|
||||
g_view = g_viewSeats[s];
|
||||
|
||||
setproperty(VF_ACTIVESEAT, (float)s);
|
||||
pSeat->m_ePlayer = findfloat(world, ::entnum, player_localentnum);
|
||||
|
||||
if (pSeat->m_ePlayer == world)
|
||||
continue;
|
||||
|
||||
cl = (NSClient)pSeat->m_ePlayer;
|
||||
setproperty(VF_ACTIVESEAT, (float)s);
|
||||
|
||||
/* set up our single/split viewport */
|
||||
View_CalcViewport(s, w, h);
|
||||
|
|
|
@ -427,6 +427,14 @@ static float env_beam_jitlut[BEAM_COUNT] = {
|
|||
float
|
||||
env_beam::predraw(void)
|
||||
{
|
||||
vector vecPlayer;
|
||||
NSClientPlayer pl;
|
||||
|
||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||
pSeat = &g_seats[s];
|
||||
pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vecPlayer = pl.GetEyePos();
|
||||
|
||||
/* only draw when active. */
|
||||
if (!m_iActive)
|
||||
return (PREDRAW_NEXT);
|
||||
|
@ -445,7 +453,7 @@ env_beam::predraw(void)
|
|||
if (m_strTexture) {
|
||||
float last_progression = 0.0f;
|
||||
makevectors(g_view.GetCameraAngle());
|
||||
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin);
|
||||
setproperty(VF_ORIGIN, vecPlayer);
|
||||
R_BeginPolygon(m_strTexture, DRAWFLAG_ADDITIVE, 0);
|
||||
|
||||
for (float i = 0; i < BEAM_COUNT; i++) {
|
||||
|
|
|
@ -315,6 +315,14 @@ static float env_laser_jitlut[LASER_COUNT] = {
|
|||
float
|
||||
env_laser::predraw(void)
|
||||
{
|
||||
vector vecPlayer;
|
||||
NSClientPlayer pl;
|
||||
|
||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||
pSeat = &g_seats[s];
|
||||
pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vecPlayer = pl.GetEyePos();
|
||||
|
||||
/* only draw when active. */
|
||||
if (!m_iActive)
|
||||
return (PREDRAW_NEXT);
|
||||
|
@ -333,7 +341,7 @@ env_laser::predraw(void)
|
|||
if (m_strTexture) {
|
||||
float last_progression = 0.0f;
|
||||
makevectors(g_view.GetCameraAngle());
|
||||
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin);
|
||||
setproperty(VF_ORIGIN, vecPlayer);
|
||||
R_BeginPolygon(m_strTexture, DRAWFLAG_ADDITIVE, 0);
|
||||
|
||||
for (float i = 0; i < LASER_COUNT; i++) {
|
||||
|
|
|
@ -105,10 +105,12 @@ prop_rope::predraw(void)
|
|||
vector pos2;
|
||||
float segments;
|
||||
vector vecPlayer;
|
||||
NSClientPlayer pl;
|
||||
|
||||
int s = (float)getproperty(VF_ACTIVESEAT);
|
||||
pSeat = &g_seats[s];
|
||||
vecPlayer = pSeat->m_vecPredictedOrigin;
|
||||
pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vecPlayer = pl.GetEyePos();
|
||||
|
||||
/* draw the start/end without segments */
|
||||
if (autocvar_rope_debug == TRUE) {
|
||||
|
|
Loading…
Reference in a new issue