I'd recommend you read Bjarne Stroustrup's "The C++ Programming Language" or
a similar C++ introduction if the code you have there is what you're
actually using.

While it is legal to test a string literal like you have, it doesn't make
any sense at all. A string literal will always evaluate as true, because
it's a const char* with a non-zero value, and any non-zero pointer converted
to bool is true.

Regards,

Paul

On Wed, Jul 30, 2008 at 10:40 AM, Yorg Kuijs <[EMAIL PROTECTED]> wrote:

> Been messing around for about 2 hours now and I think I almost got it
> currently using this code:
>    if ( "weapon_superfrag" )
>    {
>        EmitSound( "HolyGrenade.Explode" );
>    }
>    else if ( "weapon_frag" )
>    {
>        EmitSound( "BaseGrenade.Explode" );
>    }
>
>
> the problem I have is though that it seems to be ignoring the if's and
> just plays both sounds as if no if was specified at all.. so it just
> plays both HolyGrenade.Explode AND BaseGrenade.Explode for both grenades
> when it explodes. Any idea why it's completely ignoring the ifs?(it
> compiles without errors so it should be accepting the ifs, cause earlier
> it wasnt now doing it like this it didn't produce errors)
>
> _______________________________________________
> 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