From 597c9906831bd5a60e29f589d12df6a1f67480e8 Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Mon, 27 May 2013 23:53:22 +0200 Subject: [PATCH] more fixes --- code/game/g_target.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/game/g_target.c b/code/game/g_target.c index b9b5749..621ee27 100644 --- a/code/game/g_target.c +++ b/code/game/g_target.c @@ -49,15 +49,15 @@ void Use_Target_Give( gentity_t *ent, /*@unused@*/ gentity_t *other, gentity_t * //FIXME: Make the text parsed on load time. saves on resources!! void SP_target_give( gentity_t *ent ) { - char *items; - char *textPtr; - char *token; - int weapon; + char* items; + char* textPtr; + char* token; + unsigned weapon; G_SpawnString( "items", "", &items ); if(strcmp(items, "") == 0 && ent->target != NULL) { // spawnTEnt - items = ent->target; + items = G_NewString(ent->target);G } if(items == NULL) { @@ -70,21 +70,21 @@ void SP_target_give( gentity_t *ent ) COM_BeginParseSession(); - while ( 1 ) + while (qtrue) { token = COM_Parse( &textPtr ); - if ( !token[0] ) + if ( token == NULL || token[0] == 0 ) { break; + } - if ( !Q_stricmpn( token, "|", 1 ) ) + if ( Q_stricmpn( token, "|", 1 ) == 0 ) { continue; + } - if( !Q_stricmpn( token, "WP_", 3 ) ) - { + if( Q_stricmpn( token, "WP_", 3 ) == 0) { weapon = GetIDForString( WeaponTable, token ); - if ( weapon >= 0 ) - { + if ( weapon >= 0 ) { ent->s.time |= (1<