Potential health save bug

After updating GetCurrentParty to return a list of alive party members, the BattleSystem has got a smaller list of partyBattlers compared to the PartyManager’s list of currentParty.

So, if the first player character has 0 hit points at the start of a battle, they aren’t included in the party battlers list. But at the end of the battle, we save the health of the partyBattlers[0] back to current party 0 which can effectively heal our dead PC.

To fix this, I updated SaveHealth in the PartyManager thusly:

public void SaveHealth(int partyMember, int health)
{
    List<PartyMember> members = GetAliveParty();
    members[partyMember].ChangeHealth(health);
}
1 Like

Hey, that’s a good fix! Well done!

I’m going to change this to a Show so that it sticks out for others to see the tip.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms