Maybe he's trying to keep the amount of programming lines down to a minimum?

I was bored, so let's see if outlook can do it any better.

Vector EndPoint;
trace_t tr;

if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_SPEED && mv->m_nButtons
& IN_FORWARD )
{
        for(i = 0; i < 2; i++)
                EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] *
24.0f;

        UTIL_TraceLine( player->GetAbsOrigin(), EndPoint,
MASK_SOLID_BRUSHONLY, NULL, COLLISION_GROUP_NONE, &tr);

        if( tr.fraction < 1.0 ) // There is a wall
        {
                player->SetMoveType( MOVETYPE_WALL );
        } else
        { // no wall
                mv->m_nOldButtons |= IN_JUMP;
                return false;
        }
}

if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_FORWARD )
{
        for(i = 0; i < 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] +
m_vecRight[i] * 24.0f;
        UTIL_TraceLine( player->GetAbsOrigin(), EndPoint,
MASK_SOLID_BRUSHONLY, NULL, COLLISION_GROUP_NONE, &tr);
        if( tr.fraction < 1.0 ) // There is a wall
        {
                player->SetMoveType( MOVETYPE_WALL );
        }
        else
        { // no wall
                mv->m_nOldButtons |= IN_JUMP;
                return false;
        }
}

if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_SPEED && mv->m_nButtons
& IN_FORWARD )
{
        for(i = 0; i < 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] +
m_vecRight[i] * -24.0f;
        UTIL_TraceLine( player->GetAbsOrigin(), EndPoint,
MASK_SOLID_BRUSHONLY, NULL, COLLISION_GROUP_NONE, &tr);
        if( tr.fraction < 1.0 ) // There is a wall
        {
                player->SetMoveType( MOVETYPE_WALL );
        }
        else
        { // no wall
                mv->m_nOldButtons |= IN_JUMP;
                return false;
        }
}

if( mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_FORWARD )
{
        for(i = 0; i < 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] +
m_vecRight[i] * -24.0f;
        UTIL_TraceLine( player->GetAbsOrigin(), EndPoint,
MASK_SOLID_BRUSHONLY, NULL, COLLISION_GROUP_NONE, &tr);

        if( tr.fraction < 1.0 ) // There is a wall
        {
                player->SetMoveType( MOVETYPE_WALL );
        } else { // no wall
                player->mv->m_nOldButtons |= IN_JUMP;
                return false;
        }
}

- voogru.

-----Original Message-----
From: Jonathan Murphy [mailto:[EMAIL PROTECTED]
Sent: Friday, November 02, 2007 2:41 AM
To: hlcoders@list.valvesoftware.com
Subject: Re: [hlcoders] Wall running.

--
[ Picked text/plain from multipart/alternative ]
If you code like that then you are the most elite programmer I've ever
encountered.

Seriously though I think your e-mail client has removed all your newlines
and/or whitespace, you should try sending from something other than Hotmail
possibly.

On 11/2/07, kitson foo <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
>
> hey guys i'm currently doing a wall run for my mod and i've encountered an
> error when i tried doing it in the engine.
> This is the error that i get :
> Bogus pmove player movetype 2 on (1) 0=cl 1=sv
>
> The bottom is my codes. any help i can get would be much appreciated.
> Vector EndPoint; trace_t tr; if( mv->m_nButtons & IN_STUNT &&
> mv->m_nButtons & IN_SPEED && mv->m_nButtons & IN_FORWARD ) { for(i = 0; i
<
> 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * 24.0f;
> UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY,
> NULL, COLLISION_GROUP_NONE, &tr); if( tr.fraction < 1.0 ) // There is a
> wall { player->SetMoveType( MOVETYPE_WALL ); } else { // no wall
> mv->m_nOldButtons |= IN_JUMP; return false; } } if( mv->m_nButtons &
> IN_STUNT && mv->m_nButtons & IN_FORWARD ) { for(i = 0; i < 2; i++)
> EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * 24.0f;
> UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY,
> NULL, COLLISION_GROUP_NONE, &tr); if( tr.fraction < 1.0 ) // There is a
> wall { player->SetMoveType( MOVETYPE_WALL ); } else { // no wall
> mv->m_nOldButtons |= IN_JUMP; return false; } } if( mv->m_nButtons &
> IN_STUNT && mv->m_nButtons & IN_SPEED && mv->m_nButtons & IN_FORWARD ) {
> for(i = 0; i < 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] +
> m_vecRight[i] * -24.0f; UTIL_TraceLine( player->GetAbsOrigin(), EndPoint,
> MASK_SOLID_BRUSHONLY, NULL, COLLISION_GROUP_NONE, &tr); if( tr.fraction <
> 1.0 ) // There is a wall { player->SetMoveType( MOVETYPE_WALL ); } else {
> // no wall mv->m_nOldButtons |= IN_JUMP; return false; } } if(
> mv->m_nButtons & IN_STUNT && mv->m_nButtons & IN_FORWARD ) { for(i = 0; i
<
> 2; i++) EndPoint[i] = player->GetAbsOrigin()[i] + m_vecRight[i] * -24.0f;
> UTIL_TraceLine( player->GetAbsOrigin(), EndPoint, MASK_SOLID_BRUSHONLY,
> NULL, COLLISION_GROUP_NONE, &tr); if( tr.fraction < 1.0 ) // There is a
> wall {
> player->SetMoveType( MOVETYPE_WALL ); } else { // no wall
> mv->m_nOldButtons |= IN_JUMP; return false; } }
> _________________________________________________________________
> Get your free suite of Windows Live services!
> http://www.get.live.com/wl/all
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--
Programmer for Resistance and Liberation
www.resistanceandliberation.com
Programmer for Red Tribe
www.redtribe.com
--

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


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

Reply via email to