From d7457925db661800e7f2366b19218667ce5eae4b Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 27 Apr 2019 19:20:18 +0200 Subject: [PATCH] Don't allow 'give health 0' or even less. Giving the player < -1 health and increasing it to something above 0 without closing the console breaks the player state. --- src/g_cmds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/g_cmds.c b/src/g_cmds.c index 47133a6..eeeb2d1 100644 --- a/src/g_cmds.c +++ b/src/g_cmds.c @@ -229,6 +229,7 @@ Cmd_Give_f(edict_t *ent) if (gi.argc() == 3) { ent->health = atoi(gi.argv(2)); + ent->health = ent->health < 1 ? 1 : ent->health; } else {