Skip to content

Commit

Permalink
Fix hp/mp overflowing calculated maxhp/maxmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Sep 28, 2024
1 parent 7b0fa40 commit 4c8fb3f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ public async Task Modify(Action<IFieldUserModify> action)
await UpdateStats();
if (modify.IsRequireUpdateAvatar)
await UpdateAvatar();

if (Character.HP > Stats.MaxHP)
await modify.Stats(s => s.HP = Stats.MaxHP);
if (Character.MP > Stats.MaxMP)
await modify.Stats(s => s.MP = Stats.MaxMP);
}
finally
{
Expand Down

0 comments on commit 4c8fb3f

Please sign in to comment.