Removing the IsInAir conditional broke the rain completely. No rain or
splashes at all now.

On Thu, May 20, 2010 at 8:13 AM, Tony "omega" Sergi <omegal...@gmail.com> wrote:
> and remove all of the other randoms other than what that i changed the code
> to.
> So for the final output:
>
>    /*Tony; the traceline replaces the IsInAir check.
>    you also don't want the random's to be around the traceline either, or
> it will only check SOMETIMES. it needs to check _all_ the time.
>    you also probably want to do some radius checking of the particles
> position (ignoring z) for if it's in range of the local player to run this
> code or not
>    otherwise you will have traces for every particle all over the place
> even if there's no way that the player can see it
>    so when the player is out of that radius, you would only use if (
> !IsInAir( pParticle->m_Pos ) { return false; }
>   */
>    trace_t trace;
>    UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_SOLID, NULL,
> COLLISION_GROUP_NONE, &trace);
>    if( trace.fraction < 1 || trace.DidHit() )
>    {
>        if ( RandomInt( 0, 100 ) <= r_RainSplashPercentage.GetInt() )
>            DispatchParticleEffect( "rain_splash",
> trace.endpos,trace.m_pEnt->GetAbsAngles() , NULL );
>
>        // Tell the framework it's time to remove the particle from the list
>        return false;
>    }
>    // We still want this particle
>    return true;
>
> -Tony
>
> On Thu, May 20, 2010 at 7:16 PM, Saul Rennison <saul.renni...@gmail.com>wrote:
>
>> Remove the IsInAir conditional, that's your issue.
>>
>> On Thursday, May 20, 2010, James K <jimmy4...@gmail.com> wrote:
>> > I don't want to post the whole file because I really haven't changed
>> > anything else and that would be massive, so here's the tidbit i'm
>> > working with. The whole file is c_effects.cpp if you need to see the
>> > rest.
>> >
>> >         // No longer in the air? punt.
>> >         if ( !IsInAir( pParticle->m_Pos ) )
>> >         {
>> >                 // Possibly make a splash if we hit a water surface and
>> it's in
>> > front of the view.
>> >                 if ( m_Splashes.Count() < 99 )
>> >                 {
>> >                         if ( RandomInt( 0, 100 ) <
>> r_RainSplashPercentage.GetInt() )
>> >                         {
>> >    trace_t trace;
>> >    UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_ALL, NULL,
>> > COLLISION_GROUP_NONE, &trace);
>> >    if( trace.fraction < 1 || trace.DidHit() )
>> >    {
>> >        if ( RandomInt( 0, 100 ) <= r_RainSplashPercentage.GetInt() )
>> >            DispatchParticleEffect( "rain_splash", trace.endpos,
>> > trace.m_pEnt->GetAbsAngles() , NULL );
>> >    }
>> >                         }
>> >                 }
>> >
>> >                 // Tell the framework it's time to remove the particle
>> from the list
>> >                 return false;
>> >         }
>> >
>> >         // We still want this particle
>> >         return true;
>> > }
>> >
>>
> _______________________________________________
> 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