Fixed IsNightTime not handling factory night/day raids
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user