diff --git a/CHANGELOG.md b/CHANGELOG.md index 93fe50e0..bd273919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased](https://github.com/LostArtefacts/TR-Rando/compare/V1.9.1...master) - xxxx-xx-xx - fixed docile bird monsters causing multiple Laras to spawn in remastered levels (#723) +- fixed the incomplete skidoo model in TR2R when it appears anywhere other than Tibetan Foothills (#721) - improved data integrity checks when opening a folder and prior to randomization (#719) ## [V1.9.1](https://github.com/LostArtefacts/TR-Rando/compare/V1.9.0...V1.9.1) - 2024-06-23 diff --git a/TRDataControl/Data/Remastered/BaseTRRDataCache.cs b/TRDataControl/Data/Remastered/BaseTRRDataCache.cs index b462834d..d0ac75ed 100644 --- a/TRDataControl/Data/Remastered/BaseTRRDataCache.cs +++ b/TRDataControl/Data/Remastered/BaseTRRDataCache.cs @@ -72,6 +72,15 @@ public void SetPDPData(TRDictionary pdpData, TKey sourceType, TKe public void SetMapData(Dictionary mapData, TKey sourceType, TKey destinationType) { TAlias alias = GetAlias(sourceType); + Dictionary dependencies = GetMapDependencies(sourceType); + if (dependencies != null) + { + foreach (var (depKey, depAlias) in dependencies) + { + mapData[depKey] = depAlias; + } + } + if (EqualityComparer.Default.Equals(alias, default)) { return; @@ -86,4 +95,6 @@ public void SetMapData(Dictionary mapData, TKey sourceType, TKey d public abstract TKey TranslateKey(TKey key); public abstract TKey TranslateAlias(TKey alias); public abstract TAlias GetAlias(TKey key); + protected virtual Dictionary GetMapDependencies(TKey key) + => null; } diff --git a/TRDataControl/Data/Remastered/TR2RDataCache.cs b/TRDataControl/Data/Remastered/TR2RDataCache.cs index 2ebd9f1a..4bcb9b78 100644 --- a/TRDataControl/Data/Remastered/TR2RDataCache.cs +++ b/TRDataControl/Data/Remastered/TR2RDataCache.cs @@ -24,6 +24,16 @@ public override string GetSourceLevel(TR2Type key) public override TR2RAlias GetAlias(TR2Type key) => _mapAliases.ContainsKey(key) ? _mapAliases[key] : default; + protected override Dictionary GetMapDependencies(TR2Type key) + => key == TR2Type.RedSnowmobile ? _skidooDependencies : null; + + private static readonly Dictionary _skidooDependencies = new() + { + [TR2Type.CutsceneActor4] = TR2RAlias.SKIDOO_TRACK_1, + [TR2Type.CutsceneActor5] = TR2RAlias.SKIDOO_TRACK_2, + [TR2Type.CutsceneActor6] = TR2RAlias.SKIDOO_TRACK_3, + }; + private static readonly Dictionary _sourceLevels = new() { [TR2Type.Crow] = TR2LevelNames.GW,