- Simplify more, found by code inspection.

This commit is contained in:
Edoardo Prezioso 2016-04-21 16:03:33 +02:00
parent 6aca7604eb
commit 6cfd82f500

View file

@ -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)