Skip to content

Commit

Permalink
Merge pull request #99 from edbmods/develop
Browse files Browse the repository at this point in the history
Merge to master v0.16.1.3
  • Loading branch information
edbmods committed Dec 24, 2016
2 parents bd28421 + c363a75 commit 0a14128
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
3 changes: 1 addition & 2 deletions EdBPrepareCarefully.csproj
Expand Up @@ -7,10 +7,9 @@
<OutputType>Library</OutputType>
<RootNamespace>EdB.PrepareCarefully</RootNamespace>
<AssemblyName>EdBPrepareCarefully</AssemblyName>
<ReleaseVersion>0.16.1.2</ReleaseVersion>
<ReleaseVersion>0.16.1.3</ReleaseVersion>
<UseMSBuildEngine>False</UseMSBuildEngine>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ApplicationManifest>Dialog_Confirm.cs.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
6 changes: 3 additions & 3 deletions EdBPrepareCarefully.sln
Expand Up @@ -22,9 +22,9 @@ Global
$0.TextStylePolicy = $2
$2.FileWidth = 120
$2.TabsToSpaces = False
$2.inheritsSet = VisualStudio
$2.inheritsSet = null
$2.inheritsScope = text/plain
$2.scope = text/plain
$2.scope = application/xml
$0.CSharpFormattingPolicy = $3
$3.IndentSwitchBody = True
$3.ElseNewLinePlacement = NewLine
Expand Down Expand Up @@ -194,6 +194,6 @@ Global
$29.IncludeStaticEntities = True
$0.VersionControlPolicy = $31
$31.inheritsSet = Mono
version = 0.16.1.2
version = 0.16.1.3
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion("0.16.1.2")]
[assembly: AssemblyVersion("0.16.1.3")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
2 changes: 1 addition & 1 deletion Resources/About/About.xml
Expand Up @@ -8,6 +8,6 @@

If you get a set of starting colonists that you like, save them as a preset so that you can start your game the same way next time.

[Version 0.16.1.2]
[Version 0.16.1.3]
</description>
</ModMetaData>
7 changes: 7 additions & 0 deletions Resources/CHANGELOG.txt
@@ -1,3 +1,10 @@
_____________________________________________________________________________

Version 0.16.1.3
_____________________________________________________________________________

- Fixed the way that the option list for bionics/implants is built.

_____________________________________________________________________________

Version 0.16.1.2
Expand Down
22 changes: 20 additions & 2 deletions Source/BodyPartDictionary.cs
Expand Up @@ -64,8 +64,9 @@ public BodyPartDictionary(ThingDef pawnThingDef)
}

// Find all recipes that replace a body part.
recipes.AddRange(pawnThingDef.recipes.Where((RecipeDef def) => {
if (def.addsHediff != null && def.appliedOnFixedBodyParts != null && def.appliedOnFixedBodyParts.Count > 0) {
recipes.AddRange(DefDatabase<RecipeDef>.AllDefs.Where((RecipeDef def) => {
if (def.addsHediff != null && def.appliedOnFixedBodyParts != null && def.appliedOnFixedBodyParts.Count > 0
&& (def.recipeUsers.NullOrEmpty() || def.recipeUsers.Contains(pawnThingDef))) {
return true;
}
else {
Expand Down Expand Up @@ -101,6 +102,23 @@ public BodyPartDictionary(ThingDef pawnThingDef)
}
}

// Remove any recipe that has no relevant body parts.
List<RecipeDef> recipesToRemove = new List<RecipeDef>();
foreach (var r in recipes) {
List<BodyPartRecord> bodyPartRecords;
if (recipeBodyParts.TryGetValue(r, out bodyPartRecords)) {
if (bodyPartRecords.Count == 0) {
recipesToRemove.Add(r);
}
}
else {
recipesToRemove.Add(r);
}
}
foreach (var r in recipesToRemove) {
recipes.Remove(r);
}

// Sort the recipes.
recipes.Sort((RecipeDef a, RecipeDef b) => {
return a.LabelCap.CompareTo(b.LabelCap);
Expand Down

0 comments on commit 0a14128

Please sign in to comment.