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