diff options
author | M. Kristall <mkpdev@gmail.com> | 2012-09-04 03:57:03 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:26:21 +0000 |
commit | de9f9bc5e0210bf53f43681990a9a683d5a4452c (patch) | |
tree | 39009b9df8015e9e67810c88db71949bc00176a2 /src/game/g_admin.c | |
parent | c21fc9efb4694f66366645487a2add25abdf3590 (diff) |
* Expire bans with unban instead of immediately removing them so that things
like unban 6; unban 7 work as expected
Diffstat (limited to 'src/game/g_admin.c')
-rw-r--r-- | src/game/g_admin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 085b394c..782f2aca 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1782,6 +1782,11 @@ qboolean G_admin_unban( gentity_t *ent ) ADMP( "^3unban: ^7invalid ban#\n" ); return qfalse; } + if( ban->expires > 0 && ban->expires - time <= 0 ) + { + ADMP( "^3unban: ^7ban already expired\n" ); + return qfalse; + } if( !G_admin_permission( ent, ADMF_CAN_PERM_BAN ) && ( ban->expires == 0 || ( ban->expires - time > MAX( 1, G_admin_parse_time( g_adminMaxBan.string ) ) ) ) ) @@ -1796,11 +1801,7 @@ qboolean G_admin_unban( gentity_t *ent ) bnum, ban->name, ( ent ) ? ent->client->pers.netname : "console" ) ); - if( p == ban ) - g_admin_bans = ban->next; - else - p->next = ban->next; - BG_Free( ban ); + p->expires = time; admin_writeconfig(); return qtrue; } |