Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions EXILED/Exiled.API/Features/CustomHealthStat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Exiled.API.Features
{
using PlayerRoles;
using PlayerStatsSystem;

/// <summary>
Expand All @@ -17,7 +18,7 @@ public class CustomHealthStat : HealthStat
private float customMaxValue;

/// <inheritdoc/>
public override float MaxValue => CustomMaxValue == default ? base.MaxValue : CustomMaxValue;
public override float MaxValue => customMaxValue == default ? base.MaxValue : CustomMaxValue;

/// <summary>
/// Gets or sets the maximum amount of health the player will have.
Expand All @@ -27,15 +28,15 @@ public float CustomMaxValue
get
{
if (Hub.playerStats.TryGetModule(out MaxHealthStat maxHealthStat))
return maxHealthStat.CurValue;
return maxHealthStat.CurValue + HumanRole.DefaultMaxHealth;
return customMaxValue;
}

set
{
customMaxValue = value;
if (Hub.playerStats.TryGetModule(out MaxHealthStat maxHealthStat))
maxHealthStat.CurValue = value;
maxHealthStat.CurValue = value - HumanRole.DefaultMaxHealth;
}
}
}
Expand Down
36 changes: 0 additions & 36 deletions EXILED/Exiled.Events/Patches/Fixes/HumanMaxHealth.cs

This file was deleted.