Skip to content

Commit

Permalink
Fixed the initialization for humanlike hairs to avoid incorrectly fil…
Browse files Browse the repository at this point in the history
…tering out those are the allowed for alien races.
  • Loading branch information
edbmods committed Sep 1, 2018
1 parent 0dc33c2 commit 485490e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/ProviderHair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ protected OptionsHair HumanlikeHairs {
}
protected OptionsHair InitializeHumanlikeHairs() {
HashSet<string> nonHumanHairTags = new HashSet<string>();
// This was meant to remove alien race-specific hair defs from those available when customizing non-aliens.
// However, there's no way to distinguish between hair tags that are ONLY for aliens vs. the non-alien
// hair defs that are also allow for aliens. This makes the logic below fail. Instead, we'll include
// all hair def (both alien and non-alien) in the list of available hairs for non-aliens.
// TODO: Implement filtering in the hair selection to make it easier to find appropriate hairs when there
// are a lot of mods that add hairs.
/*
IEnumerable<ThingDef> alienRaces = DefDatabase<ThingDef>.AllDefs.Where((ThingDef def) => {
return def.race != null && ProviderAlienRaces.IsAlienRace(def);
});
Expand All @@ -112,6 +119,7 @@ protected OptionsHair InitializeHumanlikeHairs() {
}
}
}
*/
OptionsHair result = new OptionsHair();
foreach (HairDef hairDef in DefDatabase<HairDef>.AllDefs.Where((HairDef def) => {
foreach (var tag in def.hairTags) {
Expand Down

0 comments on commit 485490e

Please sign in to comment.