This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
client..objects.cpp

Observer this function, which i have modified here: sorry for the
lengthy code, but I think its important to show the whole function even
though its really only 3 or 4 lines that don't work.

void UpdateBeams ( void )
{
            vec3_t forward, vecSrc, vecEnd, origin, angles, right, up;
            vec3_t view_ofs;
            pmtrace_t tr;
            cl_entity_t *pthisplayer = gEngfuncs.GetLocalPlayer();
            int idx = pthisplayer->index;


            if(g_iUser1 == OBS_IN_EYE || (g_iUser1 &&
(gHUD.m_Spectator.m_pip->value == INSET_IN_EYE)) ) // this line is new
            {
                        cl_entity_t         * ent =
gEngfuncs.GetEntityByIndex( g_iUser2 ); // this line is new
                        VectorCopy ( ent->angles, angles ); // this line
is new
                        VectorCopy ( ent->origin, vecSrc ); // this line
is new
            }
            else // this line is new
            {
                        gEngfuncs.GetViewAngles( (float *)angles ); //
problem hle
                        HUD_GetLastOrg( (float *)&vecSrc );
            }

            AngleVectors( angles, forward, right, up );

            VectorMA( vecSrc, 2048, forward, vecEnd );

            gEngfuncs.pEventAPI->EV_SetUpPlayerPrediction( false, true
);

            // Store off the old count
            gEngfuncs.pEventAPI->EV_PushPMStates();

            // Now add in all of the players.
            gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 );

            gEngfuncs.pEventAPI->EV_SetTraceHull( 2 );

            gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd,
PM_STUDIO_BOX, -1, &tr );

            gEngfuncs.pEventAPI->EV_PopPMStates();

            if ( pEgonBeam )
            {
                        pEgonBeam->target = tr.endpos;
                        pEgonBeam->die             =
gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit
forward in the future, just in case.
            }

            if ( pEgonBeam2 )
            {
                        pEgonBeam2->target = tr.endpos;
                        pEgonBeam2->die            =
gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit
forward in the future, just in case.
            }
}


When the client is just shooting the egon, it works fine, but when he is
observing someone and they shoot it almost works. The trace result is
not working. I have debugged it and it is receiving the correct values
for the End and Start vector points. I'm guessing that because the
function is acting on the client, not shooting the gun but rather
spectating the shooter, it is doing something weird (I may be wrong) but
if you replace pEgonBeam->target = tr.endpos with pEgonBeam->target =
vecEnd is works without the trace checking (well it almost works).  When
in observer mode the beam correctly points in the y direction but the x
is incorrect. So in other words it rotates in circles correctly but does
not move up or down based upon what the shooter is pointing at.

I don't know why it won't track correctly. I'm really stuck with this
one.

[EMAIL PROTECTED]
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to