From 6cfd82f5009177c5a206677e3908b3abcdc0d307 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 21 Apr 2016 16:03:33 +0200 Subject: [PATCH] - Simplify more, found by code inspection. --- src/m_cheat.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index d7622b3d4..ff9e2ac9a 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -603,26 +603,12 @@ void cht_Give (player_t *player, const char *name, int amount) { if (amount > 0) { - if (player->mo) - { - player->mo->health += amount; - player->health = player->mo->health; - } - else - { - player->health += amount; - } + player->mo->health += amount; + player->health = player->mo->health; } else { - if (player->mo != NULL) - { - player->health = player->mo->health = player->mo->GetMaxHealth(); - } - else - { - player->health = deh.GodHealth; - } + player->health = player->mo->health = player->mo->GetMaxHealth(); } }