Reset limb max value after a raid
This commit is contained in:
@@ -241,5 +241,23 @@ namespace SPTarkov.Server.Core.Extensions
|
||||
|
||||
return quest?.Status ?? QuestStatusEnum.Locked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use values from the profiles template to reset all body part max values
|
||||
/// </summary>
|
||||
/// <param name="profile">Profile to update</param>
|
||||
/// <param name="profileTemplate">Template used to create profile</param>
|
||||
public static void ResetMaxLimbHp(this PmcData profile, TemplateSide profileTemplate)
|
||||
{
|
||||
foreach (var (partKey, bodyPart) in profile.Health.BodyParts)
|
||||
{
|
||||
bodyPart.Health.Maximum = profileTemplate
|
||||
.Character
|
||||
.Health
|
||||
.BodyParts[partKey]
|
||||
.Health
|
||||
.Maximum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,6 +895,13 @@ public class LocationLifecycleService(
|
||||
isDead
|
||||
);
|
||||
|
||||
// Required when player loses limb in-raid and fixes it, max now stuck at 50% or less if lost multiple times
|
||||
var profileTemplate = profileHelper.GetProfileTemplateForSide(
|
||||
fullServerProfile.ProfileInfo.Edition,
|
||||
serverPmcProfile.Info.Side
|
||||
);
|
||||
serverPmcProfile.ResetMaxLimbHp(profileTemplate);
|
||||
|
||||
if (isTransfer)
|
||||
{
|
||||
// Adjust limb hp and effects while transiting
|
||||
|
||||
Reference in New Issue
Block a user