mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-21 19:51:27 +00:00
fix max health for Doom's health bonus with Dehacked modifications present.
This commit is contained in:
parent
a31cfa97e4
commit
3f05f38a60
2 changed files with 28 additions and 1 deletions
|
@ -2545,7 +2545,7 @@ static int PatchMisc (int dummy)
|
|||
auto health = GetDefaultByName ("HealthBonus");
|
||||
if (health!=NULL)
|
||||
{
|
||||
health->IntVar(NAME_MaxAmount) = 2 * deh.MaxHealth;
|
||||
health->IntVar(NAME_MaxAmount) = -1; // needs to be evaluated at run time due to the compat flag.
|
||||
}
|
||||
|
||||
health = GetDefaultByName ("Soulsphere");
|
||||
|
|
|
@ -16,6 +16,33 @@ class HealthBonus : Health
|
|||
BON1 ABCDCB 6;
|
||||
Loop;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// TryPickup
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
override bool TryPickup (in out Actor other)
|
||||
{
|
||||
PrevHealth = other.player != NULL ? other.player.health : other.health;
|
||||
|
||||
// Dehacked max health is compatibility dependent because Boom interpreted this value wrong.
|
||||
let maxamt = MaxAmount;
|
||||
if (maxamt < 0)
|
||||
{
|
||||
maxamt = deh.MaxHealth;
|
||||
if (!(Level.compatflags & COMPATF_DEHHEALTH)) maxamt *= 2;
|
||||
}
|
||||
|
||||
if (other.GiveBody(Amount, maxamt))
|
||||
{
|
||||
GoAwayAndDie();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Stimpack -----------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue