Second attempt at fixing prestige issue #558
This commit is contained in:
@@ -82,7 +82,18 @@ public class PlayerScavGenerator(
|
|||||||
pmcDataClone
|
pmcDataClone
|
||||||
);
|
);
|
||||||
|
|
||||||
// Remove cached bot data after scav was generated
|
// Add additional items to player scav as loot
|
||||||
|
AddAdditionalLootToPlayerScavContainers(
|
||||||
|
scavData.Id.Value,
|
||||||
|
playerScavKarmaSettings.LootItemsToAddChancePercent,
|
||||||
|
scavData,
|
||||||
|
[EquipmentSlots.TacticalVest, EquipmentSlots.Pockets, EquipmentSlots.Backpack]
|
||||||
|
);
|
||||||
|
|
||||||
|
// No need for cache data, clear up
|
||||||
|
botInventoryContainerService.ClearCache(scavData.Id.Value);
|
||||||
|
|
||||||
|
// Remove cached bot loot cache now scav is generated
|
||||||
botLootCacheService.ClearCache();
|
botLootCacheService.ClearCache();
|
||||||
|
|
||||||
// Add scav metadata
|
// Add scav metadata
|
||||||
@@ -112,17 +123,6 @@ public class PlayerScavGenerator(
|
|||||||
scavData.WishList = existingScavDataClone.WishList ?? new();
|
scavData.WishList = existingScavDataClone.WishList ?? new();
|
||||||
scavData.Encyclopedia = pmcDataClone.Encyclopedia ?? new();
|
scavData.Encyclopedia = pmcDataClone.Encyclopedia ?? new();
|
||||||
|
|
||||||
// Add additional items to player scav as loot
|
|
||||||
AddAdditionalLootToPlayerScavContainers(
|
|
||||||
scavData.Id.Value,
|
|
||||||
playerScavKarmaSettings.LootItemsToAddChancePercent,
|
|
||||||
scavData,
|
|
||||||
[EquipmentSlots.TacticalVest, EquipmentSlots.Pockets, EquipmentSlots.Backpack]
|
|
||||||
);
|
|
||||||
|
|
||||||
// No need for cache data, clear up
|
|
||||||
botInventoryContainerService.ClearCache(scavData.Id.Value);
|
|
||||||
|
|
||||||
// Remove secure container
|
// Remove secure container
|
||||||
scavData = profileHelper.RemoveSecureContainer(scavData);
|
scavData = profileHelper.RemoveSecureContainer(scavData);
|
||||||
|
|
||||||
|
|||||||
@@ -88,9 +88,14 @@ public class ProfileHelper(
|
|||||||
/// <param name="clonedProfile">A clone of the full player profile</param>
|
/// <param name="clonedProfile">A clone of the full player profile</param>
|
||||||
protected void SanitizeProfileForClient(SptProfile clonedProfile)
|
protected void SanitizeProfileForClient(SptProfile clonedProfile)
|
||||||
{
|
{
|
||||||
|
if (clonedProfile.CharacterData?.PmcData?.TradersInfo?.Values is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove `loyaltyLevel` from `TradersInfo`, as otherwise it causes the client to not
|
// Remove `loyaltyLevel` from `TradersInfo`, as otherwise it causes the client to not
|
||||||
// properly calculate the player's `loyaltyLevel`
|
// properly calculate the player's `loyaltyLevel`
|
||||||
foreach (var trader in clonedProfile.CharacterData?.PmcData?.TradersInfo?.Values!)
|
foreach (var trader in clonedProfile.CharacterData.PmcData.TradersInfo.Values)
|
||||||
{
|
{
|
||||||
trader.LoyaltyLevel = null;
|
trader.LoyaltyLevel = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user