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
@@ -47574,7 +47574,9 @@
"equipment": "5fe49444ae6628187a2e77b8",
"fastPanel": {},
"favoriteItems": [],
"hideoutAreaStashes": {},
"hideoutAreaStashes": {
"16": "5d494a295b56502f18c98a08"
},
"items": [{
"_id": "5fe49444ae6628187a2e77b8",
"_tpl": "55d7217a4bdc2d86028b456d"
@@ -47582,6 +47584,9 @@
"_id": "63db64cbf9963741dc0d741f",
"_tpl": "6401c7b213d9b818bf0e7dd7"
}, {
"_id": "5d494a295b56502f18c98a08",
"_tpl": "63dbd45917fff4dee40fe16e"
}, {
"_id": "676db384777490e23c45b657",
"_tpl": "673c7b00cbf4b984b5099181"
}, {
@@ -50992,7 +50997,9 @@
"equipment": "5fe49444ae6628187a2e77b8",
"fastPanel": {},
"favoriteItems": [],
"hideoutAreaStashes": {},
"hideoutAreaStashes": {
"16": "5d494a295b56502f18c98a08"
},
"items": [{
"_id": "5fe49444ae6628187a2e77b8",
"_tpl": "55d7217a4bdc2d86028b456d"
@@ -51003,6 +51010,9 @@
"_id": "676db384777490e23c45b657",
"_tpl": "673c7b00cbf4b984b5099181"
}, {
"_id": "5d494a295b56502f18c98a08",
"_tpl": "63dbd45917fff4dee40fe16e"
}, {
"_id": "f5e6bdac05e699d687993249",
"_tpl": "5857a8bc2459772bad15db29",
"parentId": "5fe49444ae6628187a2e77b8",
@@ -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>