mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- fixed: Degeneration should use the same base health value as all the rest of the engine.
- also replaced deh.MaxHealth in the bot code which was the only other remaining case where this was used as health limiter.
This commit is contained in:
parent
7755a3525a
commit
540f20882e
2 changed files with 5 additions and 4 deletions
|
@ -358,7 +358,7 @@ void DBot::WhatToGet (AActor *item)
|
||||||
}
|
}
|
||||||
else if ((typeis (Megasphere) || typeis (Soulsphere) || typeis (HealthBonus)) && player->mo->health >= deh.MaxSoulsphere)
|
else if ((typeis (Megasphere) || typeis (Soulsphere) || typeis (HealthBonus)) && player->mo->health >= deh.MaxSoulsphere)
|
||||||
return;
|
return;
|
||||||
else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= deh.MaxHealth /*MAXHEALTH*/)
|
else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= player->mo->GetMaxHealth() + player->mo->stamina)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((dest == NULL ||
|
if ((dest == NULL ||
|
||||||
|
|
|
@ -2677,10 +2677,11 @@ void P_PlayerThink (player_t *player)
|
||||||
// Apply degeneration.
|
// Apply degeneration.
|
||||||
if (dmflags2 & DF2_YES_DEGENERATION)
|
if (dmflags2 & DF2_YES_DEGENERATION)
|
||||||
{
|
{
|
||||||
if ((level.time % TICRATE) == 0 && player->health > deh.MaxHealth)
|
int maxhealth = player->mo->GetMaxHealth() + player->mo->stamina;
|
||||||
|
if ((level.time % TICRATE) == 0 && player->health > maxhealth)
|
||||||
{
|
{
|
||||||
if (player->health - 5 < deh.MaxHealth)
|
if (player->health - 5 < maxhealth)
|
||||||
player->health = deh.MaxHealth;
|
player->health = maxhealth;
|
||||||
else
|
else
|
||||||
player->health--;
|
player->health--;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue