summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-11-23 18:59:24 +0100
committerPaweł Redman <pawel.redman@gmail.com>2018-11-23 18:59:24 +0100
commit63c1562608d62bac9e3c9917e7ee47b79aef73a5 (patch)
tree347f4e3d5aedcb8b35d3eb45d19d04ca700a5533 /src/game
parent600b781dd3aa296634e2a8afb11a2ac9c30e24c7 (diff)
Fix a potential bug.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c
index 93c1d54..cb42e31 100644
--- a/src/game/g_admin.c
+++ b/src/game/g_admin.c
@@ -10620,8 +10620,11 @@ 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!curse: ^7reset by %s\n",
- ent ? G_admin_adminPrintName(ent) : "console");
+ if (ent) {
+ G_AdminsPrintf("^3!curse: ^7reset by %s\n",
+ G_admin_adminPrintName(ent));
+ }
+
return qtrue;
}
@@ -10676,7 +10679,7 @@ qboolean G_admin_curse(gentity_t *ent, int skiparg)
return qfalse;
}
- if (g_cheats.integer)
+ if (g_cheats.integer || !ent)
goto skip_protection;
if (G_admin_permission(target, ADMF_IMMUTABLE) ||
@@ -10715,9 +10718,12 @@ skip_protection:
return qfalse;
}
- G_AdminsPrintf("^3!curse: ^7%s^7 cursed %s^7 with %s = %f\n",
- ent ? G_admin_adminPrintName(ent) : "console",
- target->client->pers.netname, arg_option, value);
+ if (ent) {
+ G_AdminsPrintf("^3!curse: ^7%s^7 cursed %s^7 with %s = %f\n",
+ G_admin_adminPrintName(ent),
+ target->client->pers.netname, arg_option, value);
+ }
+
return qtrue;
}