Skip to content

Commit

Permalink
Destroy toll machine when destroying base toll benches. LanguageData …
Browse files Browse the repository at this point in the history
…compatibility fix.
  • Loading branch information
homothetyhk committed Jun 23, 2022
1 parent 185d06d commit 809df8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 11 additions & 0 deletions BenchRando/IC/BenchDestroyerModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,17 @@ private static List<ObjectDestroyer> BuildDestroyerList(BenchKey key)
SceneName = SceneNames.Mines_18,
});
}
else if (key == new BenchKey(SceneNames.Ruins1_31, "RestBench")
|| key == new BenchKey(SceneNames.Fungus3_50, "RestBench")
|| key == new BenchKey(SceneNames.Abyss_18, "RestBench"))
{
deployers.Add(new ObjectDestroyer
{
MatchType = ObjectDestroyer.NameMatchType.Path,
ObjectName = "Toll Machine Bench",
SceneName = key.SceneName,
});
}

return deployers;
}
Expand Down
12 changes: 7 additions & 5 deletions BenchRando/IC/LanguageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ internal static void Load()

private static string OverrideLanguageString(string key, string sheetTitle, string orig)
{
// If orig has already been overridden, then it was probably an ItemChanger language override
if (orig != Language.Language.GetInternal(key, sheetTitle)) return orig;

LanguageKey obj = new(sheetTitle, key);
return _languageStrings.TryGetValue(obj, out string overrideValue) ? overrideValue : orig;
if (key == null || sheetTitle == null) return orig;
if (string.IsNullOrEmpty(orig) || orig.StartsWith("#!"))
{
LanguageKey obj = new(sheetTitle, key);
return _languageStrings.TryGetValue(obj, out string value) ? value : orig;
}
return orig; // If orig has already been overridden, then it was probably an ItemChanger language override
}
}
}

0 comments on commit 809df8f

Please sign in to comment.