I noticed that if I wore the healthy hat, took a health pickup and then removed the healthy hat I had more HP than the max HP (220/200). I don’t know if it is addressed later and I’m not sure that this is the best way since I haven’t comprehended the Inventory system, but this is how I fixed it in Health.cs:
Equipment equipment;
private void Awake()
{
healthPoints = new LazyValue<float>(GetInitialHealth);
equipment = GetComponent<Equipment>();
if (equipment)
{
equipment.equipmentUpdated += UpdateHealth;
}
}
private void UpdateHealth()
{
if (healthPoints.value > GetMaxHealthPoints())
{
healthPoints.value = GetMaxHealthPoints();
}
}