summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
authorIronClawTrem <louie.nutman@gmail.com>2020-02-29 02:31:53 +0000
committerIronClawTrem <louie.nutman@gmail.com>2020-03-01 00:38:26 +0000
commitf15ee5ac6702e14a827a2643bfa893796c5659df (patch)
treeab4e325def071d9459808ccba4b34b0436090cc8 /src/game/g_cmds.c
parent89d24a818535c0c7dc51ac21d1246e2a093c4992 (diff)
add !practise command
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 4f0f919..6846a16 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -2757,14 +2757,17 @@ void Cmd_Class_f( gentity_t *ent )
if( ent->client->pers.teamSelection == PTE_ALIENS )
{
- if( newClass != PCL_ALIEN_BUILDER0 &&
- newClass != PCL_ALIEN_BUILDER0_UPG &&
- newClass != PCL_ALIEN_LEVEL0 )
+ if( !g_practise.integer )
{
- trap_SendServerCommand( ent-g_entities,
- va( "print \"You cannot spawn with class %s\n\"", s ) );
- return;
- }
+ if( newClass != PCL_ALIEN_BUILDER0 &&
+ newClass != PCL_ALIEN_BUILDER0_UPG &&
+ newClass != PCL_ALIEN_LEVEL0 )
+ {
+ trap_SendServerCommand( ent-g_entities,
+ va( "print \"You cannot spawn with class %s\n\"", s ) );
+ return;
+ }
+ }
if( !BG_ClassIsAllowed( newClass ) )
{
@@ -2781,7 +2784,8 @@ void Cmd_Class_f( gentity_t *ent )
return;
}
- if( ent->client->pers.denyBuild && ( newClass==PCL_ALIEN_BUILDER0 || newClass==PCL_ALIEN_BUILDER0_UPG ) )
+ if( ent->client->pers.denyBuild && ( newClass==PCL_ALIEN_BUILDER0 || newClass==PCL_ALIEN_BUILDER0_UPG )
+ || g_practise.integer && ( newClass==PCL_ALIEN_BUILDER0 || newClass==PCL_ALIEN_BUILDER0_UPG ) )
{
trap_SendServerCommand( ent-g_entities, "print \"Your building rights have been revoked\n\"" );
return;
@@ -2805,12 +2809,22 @@ void Cmd_Class_f( gentity_t *ent )
else if( !Q_stricmp( s, BG_FindNameForWeapon( WP_HBUILD ) ) &&
BG_WeaponIsAllowed( WP_HBUILD ) )
{
+ if( g_practise.integer )
+ {
+ trap_SendServerCommand( ent-g_entities, "print \"Your building rights have been revoked\n\"" );
+ return;
+ }
ent->client->pers.humanItemSelection = WP_HBUILD;
}
else if( !Q_stricmp( s, BG_FindNameForWeapon( WP_HBUILD2 ) ) &&
BG_WeaponIsAllowed( WP_HBUILD2 ) &&
BG_FindStagesForWeapon( WP_HBUILD2, g_humanStage.integer ) )
{
+ if( g_practise.integer )
+ {
+ trap_SendServerCommand( ent-g_entities, "print \"Your building rights have been revoked\n\"" );
+ return;
+ }
ent->client->pers.humanItemSelection = WP_HBUILD2;
}
else