summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorkai <kai@zittrig.eu>2020-05-15 11:58:19 +0100
committerkai <kai@zittrig.eu>2020-05-15 12:19:31 +0100
commitd9491f4a04be2b7b856c6ed9ba2d3882c9a690cf (patch)
tree2344da140cbedb13152d3f0b6806f44e5ff8eb67 /src/game
parent5fcebc5a836923df2b6444152a546aac1a0d44b4 (diff)
fix !hstage and !astage once and for all
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 0d4848d..c546389 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -7894,27 +7894,24 @@ qboolean G_admin_hstage( gentity_t *ent, int skiparg )
if( G_SayArgc() < minargc )
{
- ADMP( "^3!hstage: ^7usage: !hstage [#]\n" );
+ ADMP( "^3!hstage: ^7usage: !hstage ^3#\n" );
return qfalse;
}
- if( ( lvl != 1 ) | ( lvl != 2 ) | ( lvl != 3 ) )
+ G_SayArgv( 1 + skiparg, lvl_chr, sizeof( lvl_chr ) );
+
+ lvl = atoi( lvl_chr );
+
+ if( lvl < 1 || lvl > 3 )
{
ADMP( "^3!hstage: ^7invalid stage!\n" );
return qfalse;
}
- G_SayArgv( 1 + skiparg, lvl_chr, sizeof( lvl_chr ) );
+ trap_SendConsoleCommand( EXEC_APPEND, va( "g_humanStage %i", lvl - 1 ) );
- lvl = atoi(lvl_chr);
-
- lvl -= 1;
- trap_SendConsoleCommand( EXEC_APPEND, va( "g_humanStage %i", lvl ) );
- lvl += 1;
-
- AP( va( "print \"^3!hstage: ^7%s gave humans stage ^2%i^7\n\"",
- ( ent ) ? G_admin_adminPrintName( ent ) : "console",
- lvl ) );
+ AP( va( "print \"^3!hstage: ^7%s^7 gave humans stage ^3%i^7\n\"",
+ ( ent ) ? G_admin_adminPrintName( ent ) : "console", lvl ) );
return qtrue;
}
@@ -7929,27 +7926,24 @@ qboolean G_admin_astage( gentity_t *ent, int skiparg )
if( G_SayArgc() < minargc )
{
- ADMP( "^3!astage: ^7usage: !astage [#]\n" );
+ ADMP( "^3!astage: ^7usage: !astage ^3#\n" );
return qfalse;
}
- if( ( lvl != 1 ) | ( lvl != 2 ) | ( lvl != 3 ) )
+ G_SayArgv( 1 + skiparg, lvl_chr, sizeof( lvl_chr ) );
+
+ lvl = atoi( lvl_chr );
+
+ if( lvl < 1 || lvl > 3 )
{
ADMP( "^3!astage: ^7invalid stage!\n" );
return qfalse;
}
- G_SayArgv( 1 + skiparg, lvl_chr, sizeof( lvl_chr ) );
+ trap_SendConsoleCommand( EXEC_APPEND, va( "g_alienStage %i", lvl - 1 ) );
- lvl = atoi(lvl_chr);
-
- lvl -= 1;
- trap_SendConsoleCommand( EXEC_APPEND, va( "g_alienStage %i", lvl ) );
- lvl += 1;
-
- AP( va( "print \"^3!astage: ^7%s gave aliens stage ^2%i^7\n\"",
- ( ent ) ? G_admin_adminPrintName( ent ) : "console",
- lvl ) );
+ AP( va( "print \"^3!astage: ^7%s^7 gave aliens stage ^3%i^7\n\"",
+ ( ent ) ? G_admin_adminPrintName( ent ) : "console", lvl ) );
return qtrue;
}