Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const char *C_BaseEntity::GetClassname( void )
- {
- static char outstr[ 256 ];
- outstr[ 0 ] = 0;
- bool gotname = false;
- #ifndef NO_ENTITY_PREDICTION
- if ( GetPredDescMap() )
- {
- const char *mapname = GetClassMap().Lookup( GetPredDescMap()->dataClassName );
- if ( mapname && mapname[ 0 ] )
- {
- Q_strncpy( outstr, mapname, sizeof( outstr ) );
- gotname = true;
- }
- }
- #endif
- if ( !gotname )
- {
- Q_strncpy( outstr, typeid( *this ).name(), sizeof( outstr ) );
- }
- return outstr;
- }
- const char *C_BaseEntity::GetDebugName( void )
- {
- return GetClassname();
- }
- //-----------------------------------------------------------------------------
- // Purpose: Creates an entity by string name, but does not spawn it
- // Input : *className -
- // Output : C_BaseEntity
- //-----------------------------------------------------------------------------
- C_BaseEntity *CreateEntityByName( const char *className )
- {
- C_BaseEntity *ent = GetClassMap().CreateEntity( className );
- if ( ent )
- {
- return ent;
- }
- Warning( "Can't find factory for entity: %s\n", className );
- return NULL;
- }
- #ifdef _DEBUG
- CON_COMMAND( cl_sizeof, "Determines the size of the specified client class." )
- {
- if ( args.ArgC() != 2 )
- {
- Msg( "cl_sizeof <gameclassname>\n" );
- return;
- }
- int size = GetClassMap().GetClassSize( args[ 1 ] );
- Msg( "%s is %i bytes\n", args[ 1 ], size );
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement