diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_utils.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h index 17492166..047aa4c1 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -829,6 +829,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 3a4bd3f4..c11df5ba 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -479,6 +479,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 |