Fixed easy start profile templates lacking a Place of Fame stash #386

Fixed hideout stash item upgrades not being correctly sent to client
This commit is contained in:
Chomp
2025-06-13 13:22:45 +01:00
parent 54b001901a
commit cc1196717c
2 changed files with 30 additions and 4 deletions
@@ -283,8 +283,8 @@ public class HideoutController(
// Don't inform client when upgraded area is hall of fame or equipment stand, BSG doesn't inform client this specific upgrade has occurred
// will break client if sent
HashSet<HideoutAreas> check = [HideoutAreas.PlaceOfFame];
if (!check.Contains(dbHideoutArea.Type ?? HideoutAreas.NotSet))
if (ShouldAddContainerUpgradeToClientResponse(dbHideoutArea, profileParentHideoutArea.Level.GetValueOrDefault(1)))
{
AddContainerUpgradeToClientOutput(sessionId, keyForHideoutAreaStash, dbHideoutArea, hideoutStage, output);
}
@@ -315,6 +315,22 @@ public class HideoutController(
}
}
/// <summary>
/// Should the newly completed hideout area container upgrade/addition be included in client response
/// Deny when: area is place of fame + we're upgrading to level 1
/// </summary>
/// <param name="dbHideoutArea">Hideout area upgraded</param>
/// <param name="areaLevel">Level of area upgraded to</param>
/// <returns>True = it should be included</returns>
private bool ShouldAddContainerUpgradeToClientResponse(HideoutArea dbHideoutArea, int areaLevel)
{
HashSet<HideoutAreas> areaBlacklist = [HideoutAreas.PlaceOfFame];
var isOnAreaBlacklist = areaBlacklist.Contains(dbHideoutArea.Type ?? HideoutAreas.NotSet);
var isFirstStage = areaLevel == 1;
return isOnAreaBlacklist && !isFirstStage;
}
/// <summary>
/// Add an inventory item to profile from a hideout area stage data
/// </summary>