summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-02-24 10:53:58 +0100
committerPaweł Redman <pawel.redman@gmail.com>2018-02-24 10:53:58 +0100
commitaba8db59fa380e7fb97b157840f262563b423a02 (patch)
tree13d5bec91423e334afa758a9443d68429fd47484
parent50d8779208632d2cc23be36e144b0297b0c02d2b (diff)
!curse: refuse to curse players with kick protection.
-rw-r--r--src/game/g_admin.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index b696cc9..ecb53cd 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -10547,7 +10547,7 @@ qboolean G_admin_curse(gentity_t *ent, int skiparg)
adminCurses_t *curses;
if (G_SayArgc() < 2 + skiparg) {
- ADMP("^3!curse: ^7usage: !curse [target] ([option] [value])\n");
+ ADMP("^3!curse: ^7usage: !curse [target] ([option] [value]) or !curse -reset\n");
return qfalse;
}
@@ -10557,7 +10557,7 @@ qboolean G_admin_curse(gentity_t *ent, int skiparg)
for (i = 0; i < level.maxclients; i++)
memset(&level.clients[i].curses, 0, sizeof(adminCurses_t));
- G_AdminsPrintf("^3!curses: ^7reset by %s\n",
+ G_AdminsPrintf("^3!curse: ^7reset by %s\n",
ent ? G_admin_adminPrintName(ent) : "console");
return qtrue;
}
@@ -10611,7 +10611,18 @@ qboolean G_admin_curse(gentity_t *ent, int skiparg)
return qfalse;
}
- if (!admin_higher(ent, target)) {
+ if (g_cheats.integer)
+ goto skip_protection;
+
+ if (G_admin_permission(target, ADMF_IMMUTABLE) ||
+ (g_adminCurses.integer < 2 &&
+ G_admin_permission(target, ADMF_IMMUNITY))) {
+ ADMP("^3!curse: ^7the player is protected by the Pope\n");
+ return qfalse;
+ }
+
+skip_protection:
+ if (ent != target && !admin_higher(ent, target)) {
ADMP("^3!curse: ^7sorry, but your intended victim has a higher admin level than you\n");
return qfalse;
}