mirror of
https://github.com/yquake2/ctf.git
synced 2024-11-25 21:31:34 +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
c13036df55
commit
d7457925db
1 changed files with 1 additions and 0 deletions
|
@ -229,6 +229,7 @@ Cmd_Give_f(edict_t *ent)
|
||||||
if (gi.argc() == 3)
|
if (gi.argc() == 3)
|
||||||
{
|
{
|
||||||
ent->health = atoi(gi.argv(2));
|
ent->health = atoi(gi.argv(2));
|
||||||
|
ent->health = ent->health < 1 ? 1 : ent->health;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue