commit c44778a1a753a4891e009e53a3169cedae5c31b7 Author: /dev/humancontroller Date: Thu Apr 21 21:08:48 2011 +0200 add a string duplicating function into the game module diff --git a/src/game/g_local.h b/src/game/g_local.h index c12432c..5f3c0b4 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -866,6 +866,7 @@ gentity_t *G_TempEntity( vec3_t origin, int event ); void G_Sound( gentity_t *ent, int channel, int soundIndex ); void G_FreeEntity( gentity_t *e ); qboolean G_EntitiesFree( void ); +char *G_CopyString( const char *str ); void G_TouchTriggers( gentity_t *ent ); diff --git a/src/game/g_utils.c b/src/game/g_utils.c index 81474ad..968d7ee 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -483,6 +483,15 @@ qboolean G_EntitiesFree( void ) } +char *G_CopyString( const char *str ) +{ + size_t size = strlen( str ) + 1; + char *cp = BG_Alloc( size ); + memcpy( cp, str, size ); + return cp; +} + + /* ================= G_FreeEntity