mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-19 07:51:03 +00:00
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.
This commit is contained in:
parent
98b24654b6
commit
193a5b7a5c
1 changed files with 1 additions and 0 deletions
|
@ -249,6 +249,7 @@ Cmd_Give_f(edict_t *ent)
|
|||
if (gi.argc() == 3)
|
||||
{
|
||||
ent->health = (int)strtol(gi.argv(2), (char **)NULL, 10);
|
||||
ent->health = ent->health < 1 ? 1 : ent->health;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue