diff options
author | Tony J. White <tjw@tjw.org> | 2006-09-14 16:25:24 +0000 |
---|---|---|
committer | Tony J. White <tjw@tjw.org> | 2006-09-14 16:25:24 +0000 |
commit | a6cafffec826a6c84ae5a4e8fc8c77aad61103f1 (patch) | |
tree | d1cab115ae668312764199e1396f211928e2d334 /src/game/g_admin.c | |
parent | cedeac9325fd4b0a0de0a5fba1890d8368754a01 (diff) |
* (bug 2849) having a qboolean array in the level_locals_t struct seemed to
cause some qvm weirdness. converted level.teamLocked[] into two seperate
qbooleans.
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r-- | src/game/g_admin.c | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 018639a7..efcdad97 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2631,13 +2631,27 @@ qboolean G_admin_lock( gentity_t *ent, int skiparg ) ADMP( va( "^3!lock: ^7invalid team\"%c\"\n", teamName[0] ) ); return qfalse; } - if( level.teamLocked[ team ] ) + + if( team == PTE_ALIENS ) { - ADMP( va( "^3!lock: ^7%s team is already locked\n", - ( team == PTE_ALIENS ) ? "Alien" : "Human" ) ); - return qfalse; + if( level.alienTeamLocked ) + { + ADMP( "^3!lock: ^7Alien team is already locked\n" ); + return qfalse; + } + else + level.alienTeamLocked = qtrue; } - level.teamLocked[ team ] = qtrue; + else if( team == PTE_HUMANS ) { + if( level.humanTeamLocked ) + { + ADMP( "^3!lock: ^7Human team is already locked\n" ); + return qfalse; + } + else + level.humanTeamLocked = qtrue; + } + AP( va( "print \"^3!lock: ^7%s team has been locked by %s\n\"", ( team == PTE_ALIENS ) ? "Alien" : "Human", ( ent ) ? ent->client->pers.netname : "console" ) ); @@ -2664,13 +2678,27 @@ qboolean G_admin_unlock( gentity_t *ent, int skiparg ) ADMP( va( "^3!unlock: ^7invalid team\"%c\"\n", teamName[0] ) ); return qfalse; } - if( !level.teamLocked[ team ] ) + + if( team == PTE_ALIENS ) { - ADMP( va( "^3!lock: ^7%s team is not locked\n", - ( team == PTE_ALIENS ) ? "Alien" : "Human" ) ); - return qfalse; + if( !level.alienTeamLocked ) + { + ADMP( "^3!unlock: ^7Alien team is not currently locked\n" ); + return qfalse; + } + else + level.alienTeamLocked = qfalse; } - level.teamLocked[ team ] = qfalse; + else if( team == PTE_HUMANS ) { + if( !level.humanTeamLocked ) + { + ADMP( "^3!unlock: ^7Human team is not currently locked\n" ); + return qfalse; + } + else + level.humanTeamLocked = qfalse; + } + AP( va( "print \"^3!unlock: ^7%s team has been unlocked by %s\n\"", ( team == PTE_ALIENS ) ? "Alien" : "Human", ( ent ) ? ent->client->pers.netname : "console" ) ); |