diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index 790b928d..72821f6e 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -955,7 +955,7 @@ static void Cmd_Tell_f( gentity_t *ent ) { } target = &g_entities[targetNum]; - if ( !target || !target->inuse || !target->client ) { + if ( !target->inuse || !target->client ) { return; } @@ -1081,7 +1081,7 @@ static void Cmd_VoiceTell_f( gentity_t *ent, qboolean voiceonly ) { } target = &g_entities[targetNum]; - if ( !target || !target->inuse || !target->client ) { + if ( !target->inuse || !target->client ) { return; } @@ -1195,6 +1195,14 @@ void Cmd_GameCommand_f( gentity_t *ent ) { return; } + trap_Argv( 2, arg, sizeof( arg ) ); + order = atoi( arg ); + + if ( order < 0 || order >= numgc_orders ) { + trap_SendServerCommand( ent-g_entities, va("print \"Bad order: %i\n\"", order)); + return; + } + trap_Argv( 1, arg, sizeof( arg ) ); targetNum = ClientNumberFromString( ent, arg ); if ( targetNum == -1 ) { @@ -1202,15 +1210,7 @@ void Cmd_GameCommand_f( gentity_t *ent ) { } target = &g_entities[targetNum]; - if ( !target || !target->inuse || !target->client ) { - return; - } - - trap_Argv( 2, arg, sizeof( arg ) ); - order = atoi( arg ); - - if ( order < 0 || order >= numgc_orders ) { - trap_SendServerCommand( ent-g_entities, va("print \"Bad order: %i\n\"", order)); + if ( !target->inuse || !target->client ) { return; }