mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Simplify more, found by code inspection.
This commit is contained in:
parent
6aca7604eb
commit
6cfd82f500
1 changed files with 3 additions and 17 deletions
|
@ -602,28 +602,14 @@ void cht_Give (player_t *player, const char *name, int amount)
|
||||||
if (stricmp (name, "health") == 0)
|
if (stricmp (name, "health") == 0)
|
||||||
{
|
{
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
|
||||||
if (player->mo)
|
|
||||||
{
|
{
|
||||||
player->mo->health += amount;
|
player->mo->health += amount;
|
||||||
player->health = player->mo->health;
|
player->health = player->mo->health;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
player->health += amount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (player->mo != NULL)
|
|
||||||
{
|
{
|
||||||
player->health = player->mo->health = player->mo->GetMaxHealth();
|
player->health = player->mo->health = player->mo->GetMaxHealth();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
player->health = deh.GodHealth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (giveall || stricmp (name, "backpack") == 0)
|
if (giveall || stricmp (name, "backpack") == 0)
|
||||||
|
|
Loading…
Reference in a new issue