<SB> Childe Roland wrote:
Ok, I got my roommate to let me DL and mess with it on his computer.
However, I keep getting the following error when I try to compile the
client side code:

------
error C2440: 'initializing' : cannot convert from 'const char *' to 'char *'
on line 245 in "baseentity_shared.cpp"
------

The line is:

------
char *s = strchr( szKeyName, '#' );
------

I am still writing a prj for Vc6, so cant test that.

//-----------------------------------------------------------------------------
// Parse data from a map file
//-----------------------------------------------------------------------------
bool CBaseEntity::KeyValue( const char *szKeyName, const char *szValue )
{
        //!! temp hack, until worldcraft is fixed
        // strip the # tokens from (duplicate) key names
        char *s = strchr( szKeyName, '#' );
        if ( s )
        {
                *s = '\0';
        }

Why not rewrite this to this?:

//-----------------------------------------------------------------------------
// Parse data from a map file
//-----------------------------------------------------------------------------
bool CBaseEntity::KeyValue( const char *szKeyName, const char *szValue )
{
        //!! temp hack, until worldcraft is fixed
        // strip the # tokens from (duplicate) key names
        const char *s = strchr( szKeyName, '#' );
        if ( s )
        {
                *s = '\0';
        }

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



Reply via email to