Merge tag '4.0.6'

This commit is contained in:
Archangel
2025-11-18 20:28:34 +01:00
7 changed files with 24 additions and 9 deletions
@@ -2978,7 +2978,8 @@
"chrispawl89",
"hulkhan",
"LycorisOni",
"Quik"
"Quik",
"Badger"
],
"generation": {
"items": {
@@ -2969,7 +2969,8 @@
"chrispawl89",
"hulkhan",
"LycorisOni",
"Quik"
"Quik",
"Badger"
],
"generation": {
"items": {
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5312d5454b1702f8ad1495d7635e07cec2b70941d46e819f236c5eb084bbe5aa
size 19115860
oid sha256:3f35bd85bc19c6c224e0dcc0a05120b7cba412ec885c4f73613c615092a2fe96
size 19116421
@@ -20,7 +20,7 @@ public class AchievementCallbacks(AchievementController achievementController, H
}
/// <summary>
/// Handle client/achievement/statistic
/// Handle client/achievement/statistic
/// </summary>
/// <returns></returns>
public ValueTask<string> Statistic(string url, EmptyRequestData _, MongoId sessionID)
@@ -324,4 +324,14 @@ public static class ProfileExtensions
// No trader data on player profile, fail check
return false;
}
/// <summary>
/// Get Ids of traders with an unlocked status of "false"
/// </summary>
/// <param name="pmcData">Player profile</param>
/// <returns>Hashset of Trader ids</returns>
public static HashSet<MongoId> GetLockedTraderIds(this PmcData pmcData)
{
return pmcData.TradersInfo?.Where(trader => trader.Value.Unlocked == false).Select(t => t.Key).ToHashSet() ?? [];
}
}
@@ -237,6 +237,7 @@ public class RagfairOfferHelper(
? cloner.Clone(searchRequest.BuildItems.Keys.ToDictionary(key => key, ragfairOfferService.GetOffersOfType))
: searchRequest.BuildItems.Keys.ToDictionary(key => key, ragfairOfferService.GetOffersOfType);
var lockedTraders = pmcData.GetLockedTraderIds();
foreach (var (desiredItemTpl, matchingOffers) in buildItems)
{
if (matchingOffers is null)
@@ -266,6 +267,12 @@ public class RagfairOfferHelper(
if (offer.IsTraderOffer())
{
// Player hasn't unlocked trader selling this offer, skip
if (lockedTraders.Contains(offer.User.Id))
{
continue;
}
if (TraderBuyRestrictionReached(offer))
{
continue;
@@ -389,10 +389,6 @@ public class RagfairPriceService(
protected double AdjustUnreasonablePrice(UnreasonableModPrices unreasonableItemChange, MongoId itemTpl, double price)
{
var itemHandbookPrice = handbookHelper.GetTemplatePrice(itemTpl);
if (itemHandbookPrice > 0)
{
return price;
}
// Flea price is over handbook price
if (price > itemHandbookPrice * unreasonableItemChange.HandbookPriceOverMultiplier)