Release 1.11.4.1 (Winter Update)
This commit is contained in:
@@ -690,7 +690,7 @@ namespace Barotrauma
|
||||
foreach (Item containedItem in character.Inventory.AllItemsMod)
|
||||
{
|
||||
//only put into containers that draw the inventory (not ones with a hidden inventory like circuit boxes!)
|
||||
if (containedItem.OwnInventory?.Container is { DrawInventory: true } &&
|
||||
if (containedItem.OwnInventory?.Container is { DrawInventory: true } container && container.IsAccessible() &&
|
||||
containedItem.OwnInventory.TryPutItem(item, user: null, item.AllowedSlots))
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -469,7 +469,8 @@ namespace Barotrauma
|
||||
foreach (var mission in currentLocation.AvailableMissions)
|
||||
{
|
||||
//if the mission isn't shown in menus, it cannot be selected by the player -> must be something that is supposed to be automatically selected
|
||||
if (!mission.Prefab.ShowInMenus)
|
||||
//side objectives are also automatically selected
|
||||
if (!mission.Prefab.ShowInMenus || mission.Prefab.IsSideObjective)
|
||||
{
|
||||
currentLocation.SelectMission(mission);
|
||||
}
|
||||
@@ -1429,18 +1430,18 @@ namespace Barotrauma
|
||||
map = null;
|
||||
}
|
||||
|
||||
public int NumberOfMissionsAtLocation(Location location)
|
||||
public int NumberOfSelectableMissionsAtLocation(Location location)
|
||||
{
|
||||
return Map?.CurrentLocation?.SelectedMissions?.Count(m => m.Locations.Contains(location)) ?? 0;
|
||||
return Map?.CurrentLocation?.SelectedMissions?.Count(m => m.Locations.Contains(location) && !m.Prefab.IsSideObjective) ?? 0;
|
||||
}
|
||||
|
||||
public void CheckTooManyMissions(Location currentLocation, Client sender)
|
||||
{
|
||||
foreach (Location location in currentLocation.Connections.Select(c => c.OtherLocation(currentLocation)))
|
||||
{
|
||||
if (NumberOfMissionsAtLocation(location) > Settings.TotalMaxMissionCount)
|
||||
if (NumberOfSelectableMissionsAtLocation(location) > Settings.TotalMaxMissionCount)
|
||||
{
|
||||
DebugConsole.AddWarning($"Client {sender.Name} had too many missions selected for location {location.DisplayName}! Count was {NumberOfMissionsAtLocation(location)}. Deselecting extra missions.");
|
||||
DebugConsole.AddWarning($"Client {sender.Name} had too many missions selected for location {location.DisplayName}! Count was {NumberOfSelectableMissionsAtLocation(location)}. Deselecting extra missions.");
|
||||
foreach (Mission mission in currentLocation.SelectedMissions.Where(m => m.Locations[1] == location).Skip(Settings.TotalMaxMissionCount).ToList())
|
||||
{
|
||||
currentLocation.DeselectMission(mission);
|
||||
|
||||
@@ -30,11 +30,23 @@ namespace Barotrauma
|
||||
: base(preset)
|
||||
{
|
||||
Location[] locations = { GameMain.GameSession.StartLocation, GameMain.GameSession.EndLocation };
|
||||
var mission = Mission.LoadRandom(locations, seed, requireCorrectLocationType: false, missionTypes, difficultyLevel: GameMain.NetworkMember.ServerSettings.SelectedLevelDifficulty);
|
||||
float difficulty = GameMain.NetworkMember.ServerSettings.SelectedLevelDifficulty;
|
||||
var mission = Mission.LoadRandom(locations, seed, requireCorrectLocationType: false, missionTypes, difficultyLevel: difficulty);
|
||||
if (mission == null)
|
||||
{
|
||||
DebugConsole.AddWarning(
|
||||
$"Could not find any missions matching the mission types {string.Join(", ", missionTypes.Select(m => m.Value))} " +
|
||||
$"and the difficulty {difficulty}. Ignoring the difficulty requirement...");
|
||||
mission = Mission.LoadRandom(locations, seed, requireCorrectLocationType: false, missionTypes);
|
||||
}
|
||||
if (mission != null)
|
||||
{
|
||||
missions.Add(mission);
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.AddWarning($"Could not find any missions matching the mission types {string.Join(", ", missionTypes.Select(m => m.Value))}.");
|
||||
}
|
||||
}
|
||||
|
||||
protected static IEnumerable<MissionPrefab> ValidateMissionPrefabs(IEnumerable<MissionPrefab> missionPrefabs, Dictionary<Identifier, Type> missionClasses)
|
||||
|
||||
@@ -741,7 +741,7 @@ namespace Barotrauma
|
||||
var missionsToShow = missions.Where(m => m.Prefab.ShowStartMessage);
|
||||
if (missionsToShow.Count() > 1)
|
||||
{
|
||||
string joinedMissionNames = string.Join(", ", missions.Select(m => m.Name));
|
||||
string joinedMissionNames = string.Join(", ", missions.Where(static m => m.Prefab.ShowInMenus).Select(static m => m.Name));
|
||||
GUI.AddMessage(TextManager.AddPunctuation(':', TextManager.Get("Mission"), joinedMissionNames), Color.CadetBlue, playSound: false);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user