--
[ Picked text/plain from multipart/alternative ]
Mark, just for you to know it's not pointers I was comparing.

std::string mapName = STRING( gpGlobals->mapname );

mapName = mapName.substr( 0, 3 );

it's objects.


On 4/11/07, Mark Chandler <[EMAIL PROTECTED]> wrote:
>
> Doesn't make a difference.
>
> Strcmp is from c and returns 0 if they are they same and I think if they
> are
> different it returns A value greater than zero indicates that the first
> character that does not match has a greater value in str1 than in str2;
> And
> a value less than zero indicates the opposite.
>
> So just  not the strcmp (i.e. use !) and then you don't have problems with
> const conversions.
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Emiel Regis
> Sent: Wednesday, April 11, 2007 3:53 PM
> To: [email protected]
> Subject: Re: [hlcoders] Map gametype filter
>
> Btw, I think it would all be better if we used const char* and Q_strstr
> like this:
>
> {
>         const char *mapName = STRING( gpGlobals->mapname );
>
>
>         if (Q_stristr("sf_", mapName)) // Classic SourceForts CTF
>         {
>                CreateGameRulesObject( "CSFCTFGamerules" );
>         }
>         else if (Q_stristr("cr_", mapName))) // Core Run map
>         {
>                CreateGameRulesObject( "CSFCRGamerules" );
>         }
>
> and so on.
>
> _______________________________________________
> 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
>
>
--

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

Reply via email to