mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 22:42:09 +00:00
Changes suggested by DevHC:
- Remove "!target" checks from tell, vtell, and gc commands. Target was just set, cannot be NULL. - Validate "order" in gc command before "player id."
This commit is contained in:
parent
467619c034
commit
b785f8a241
1 changed files with 11 additions and 11 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue