- removed the MaxAmount fudging from MaxHealth.

This commit is contained in:
Christoph Oelckers 2019-04-26 09:58:58 +02:00
parent 933ff805f1
commit 3bb42aaff7

View file

@ -99,9 +99,7 @@ class MaxHealth : Health
override bool TryPickup (in out Actor other)
{
bool success = false;
int savedAmount = MaxAmount;
let player = PlayerPawn(other);
MaxAmount = Health;
if (player)
{
if (player.BonusHealth < savedAmount)
@ -109,10 +107,8 @@ class MaxHealth : Health
player.BonusHealth = min(player.BonusHealth + Amount, savedAmount);
success = true;
}
MaxAmount += player.BonusHealth;
}
success |= Super.TryPickup(other);
MaxAmount = savedAmount;
if (success) GoAwayAndDie();
return success;
}