diff --git a/Build_God_Api/Build_God_Api/Services/Game/CharacterAttributeCalculateService.cs b/Build_God_Api/Build_God_Api/Services/Game/CharacterAttributeCalculateService.cs index 89c90db..08e54e2 100644 --- a/Build_God_Api/Build_God_Api/Services/Game/CharacterAttributeCalculateService.cs +++ b/Build_God_Api/Build_God_Api/Services/Game/CharacterAttributeCalculateService.cs @@ -182,14 +182,8 @@ namespace Build_God_Api.Services.Game public async Task RecalculateMaxHPAsync(Character character) { - var profession = await _context.Queryable().FirstAsync(x => x.Id == character.ProfessionId); - var newMaxHP = CalculateMaxHP(character, profession); - - if (newMaxHP > 0) - { - decimal hpPercentage = character.CurrentHP / newMaxHP; - character.CurrentHP = hpPercentage * newMaxHP; - } + var attributes = await CalculateAttributesAsync(character); + character.CurrentHP = attributes.MaxHP; await _context.Updateable(character).ExecuteCommandAsync(); }