Release 1.9.7.0 - Summer Update 2025

This commit is contained in:
Regalis11
2025-06-17 16:38:11 +03:00
parent 22227f13e5
commit ea5a2bc693
297 changed files with 7344 additions and 2421 deletions
@@ -868,10 +868,28 @@ namespace Barotrauma
if (Level.IsLoadedOutpost)
{
// Only return music type for location types which have music tracks defined
var locationType = Level.Loaded.StartLocation?.Type?.Identifier;
if (locationType.HasValue && locationType != Identifier.Empty && musicClips.Any(c => c.Type == locationType))
var locationType = Level.Loaded?.StartLocation?.Type?.Identifier;
var backgroundMusicIdentifier = Level.Loaded?.StartLocation?.Type?.BackgroundMusicLocationType;
if (MatchesTrack(backgroundMusicIdentifier, out Identifier id) ||
MatchesTrack(locationType, out id))
{
return locationType.Value;
return id;
}
bool MatchesTrack(Identifier? identifier, out Identifier idValue)
{
if (identifier.HasValue && identifier.Value != Identifier.Empty)
{
if (musicClips.Any(clip => clip.Type == identifier.Value))
{
idValue = identifier.Value;
return true;
}
}
idValue = Identifier.Empty;
return false;
}
}
}