Fixed FilterBotEquipment nullref + others
Forced hideoutAreaStashes to show Forced fastPanel to show Forced bot min level to be no less than 1
This commit is contained in:
@@ -435,7 +435,7 @@ public class BotEquipmentModGenerator(
|
||||
_botConfig.Equipment.TryGetValue(request.BotData.EquipmentRole, out var botEquipConfig);
|
||||
var botEquipBlacklist = _botEquipmentFilterService.GetBotEquipmentBlacklist(
|
||||
request.BotData.EquipmentRole,
|
||||
pmcProfile.Info.Level ?? 0
|
||||
pmcProfile?.Info?.Level ?? 0
|
||||
);
|
||||
var botWeaponSightWhitelist = _botEquipmentFilterService.GetBotWeaponSightWhitelist(
|
||||
request.BotData.EquipmentRole
|
||||
|
||||
@@ -120,8 +120,8 @@ public class BotInventoryGenerator(
|
||||
QuestRaidItems = questRaidItemsId,
|
||||
QuestStashItems = questStashItemsId,
|
||||
SortingTable = sortingTableId,
|
||||
HideoutAreaStashes = { },
|
||||
FastPanel = { },
|
||||
HideoutAreaStashes = new Dictionary<string, string>(),
|
||||
FastPanel = new Dictionary<string, string>(),
|
||||
FavoriteItems = [],
|
||||
HideoutCustomizationStashId = hideoutCustomizationStashId,
|
||||
};
|
||||
@@ -203,7 +203,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public class BotInventoryGenerator(
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GenerateModsBlacklist = [ItemTpl.POCKETS_1X4_TUE, ItemTpl.POCKETS_LARGE],
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -240,7 +240,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -255,7 +255,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -270,7 +270,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -285,7 +285,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -320,7 +320,7 @@ public class BotInventoryGenerator(
|
||||
Inventory = botInventory,
|
||||
BotEquipmentConfig = botEquipConfig,
|
||||
RandomisationDetails = randomistionDetails,
|
||||
GeneratingPlayerLevel = pmcProfile.Info.Level,
|
||||
GeneratingPlayerLevel = pmcProfile?.Info?.Level ?? 1,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ public class BotLevelGenerator(
|
||||
)
|
||||
: Math.Min(levelDetails.Min.Value, maxAvailableLevel); // Not pmc with override or non-pmc
|
||||
|
||||
// Force min level to be 1
|
||||
minPossibleLevel = Math.Max(1, minPossibleLevel);
|
||||
|
||||
var maxPossibleLevel = isPmc && pmcOverride is not null
|
||||
? Math.Min(pmcOverride.Max.Value, maxAvailableLevel) // Was a PMC and they have a level override
|
||||
: Math.Min(levelDetails.Max.Value, maxAvailableLevel); // Not pmc with override or non-pmc
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BotEquipmentFilterService
|
||||
var botWeightingAdjustments = GetBotWeightingAdjustments(botRole, botLevel);
|
||||
var botWeightingAdjustmentsByPlayerLevel = GetBotWeightingAdjustmentsByPlayerLevel(
|
||||
botRole,
|
||||
pmcProfile.Info.Level ?? 0
|
||||
pmcProfile?.Info?.Level ?? 0
|
||||
);
|
||||
|
||||
var botEquipConfig = _botEquipmentConfig[botRole.ToLower()];
|
||||
|
||||
Reference in New Issue
Block a user