Fixed IsNightTime not handling factory night/day raids

This commit is contained in:
Chomp
2025-05-04 14:02:09 +01:00
parent bd5f7df3d8
commit 4ea63711a9
2 changed files with 13 additions and 3 deletions
@@ -190,11 +190,11 @@ public class BotInventoryGenerator(
if (
randomistionDetails?.NighttimeChanges is not null &&
raidConfig is not null &&
_weatherHelper.IsNightTime(raidConfig.TimeVariant)
_weatherHelper.IsNightTime(raidConfig.TimeVariant, raidConfig.Location)
)
{
foreach (var equipmentSlotKvP in randomistionDetails.NighttimeChanges.EquipmentModsModifiers)
// Never let mod chance go outside of 0 - 100
// Never let mod chance go outside 0 - 100
{
randomistionDetails.EquipmentMods[equipmentSlotKvP.Key] = Math.Min(
Math.Max(randomistionDetails.EquipmentMods[equipmentSlotKvP.Key] + equipmentSlotKvP.Value, 0),
@@ -41,9 +41,19 @@ public class WeatherHelper(
/// Is the current raid at nighttime
/// </summary>
/// <param name="timeVariant">PASS OR CURR (from raid settings)</param>
/// <param name="mapLocation">map name. E.g. factory4_day</param>
/// <returns>True when nighttime</returns>
public bool IsNightTime(DateTimeEnum timeVariant)
public bool IsNightTime(DateTimeEnum timeVariant, string mapLocation)
{
switch (mapLocation)
{
// Factory differs from other maps, has static times
case "factory4_night":
return true;
case "factory4_day":
return false;
}
var time = GetInRaidTime();
// getInRaidTime() provides left side value, if player chose right side, set ahead 12 hrs