Skip to content

Commit

Permalink
Merge pull request #269 from edbmods/develop
Browse files Browse the repository at this point in the history
Merge develop into master for 1.14
  • Loading branch information
edbmods authored Nov 4, 2019
2 parents 74d7029 + 8eaf4ed commit 28c782e
Show file tree
Hide file tree
Showing 11 changed files with 325 additions and 467 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end_of_line = lf
indent_size = 4
continuation_indent_size = 8
insert_final_newline = true
charset = utf-8-bom
charset = utf-8
###############################
# .NET Coding Conventions #
###############################
Expand Down
1 change: 0 additions & 1 deletion EdBPrepareCarefully.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
<Compile Include="Source\SelectedAnimal.cs" />
<Compile Include="Source\EquipmentSelection.cs" />
<Compile Include="Source\SelectedPet.cs" />
<Compile Include="Source\StandardEquipment.cs" />
<Compile Include="Source\TabRecordExtensions.cs" />
<Compile Include="Source\Version3\SaveRecordEquipmentV3.cs" />
<Compile Include="Source\IEquipment.cs" />
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
Expand All @@ -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("1.0.13")]
[assembly: AssemblyVersion("1.0.14")]

// 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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 1.0.13]
[Version 1.0.14]
</description>
</ModMetaData>
2 changes: 1 addition & 1 deletion Resources/About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>EdBPrepareCarefully</identifier>
<version>1.0.13</version>
<version>1.0.14</version>
<loadAfter>
<li>Core</li>
<li>HugsLib</li>
Expand Down
7 changes: 7 additions & 0 deletions Resources/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
_____________________________________________________________________________

Version 1.0.14
_____________________________________________________________________________

- Fixed "memory leak" issue when displaying the equipment tab.

_____________________________________________________________________________

Version 1.0.13
Expand Down
23 changes: 6 additions & 17 deletions Source/EquipmentDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,18 @@ public EquipmentType ClassifyThingDef(ThingDef def) {
return null;
}

private HashSet<string> categoryLookup = new HashSet<string>();
// A duplicate of ThingDef.IsWithinCategory(), but with checks to prevent infinite recursion.
private HashSet<string> categoryLookup = new HashSet<string>();
public bool BelongsToCategoryOrParentCategory(ThingDef def, ThingCategoryDef categoryDef) {
if (categoryDef == null || def.thingCategories == null) {
if (categoryDef == null || def.thingCategories == null || def.thingCategories.Count == 0) {
return false;
}
categoryLookup.Clear();
for (int i = 0; i < def.thingCategories.Count; i++) {
for (ThingCategoryDef thingCategoryDef = def.thingCategories[i]; thingCategoryDef != null && !categoryLookup.Contains(thingCategoryDef.defName); thingCategoryDef = thingCategoryDef.parent) {
for (ThingCategoryDef thingCategoryDef = def.thingCategories[i];
thingCategoryDef != null && !categoryLookup.Contains(thingCategoryDef.defName);
thingCategoryDef = thingCategoryDef.parent)
{
categoryLookup.Add(thingCategoryDef.defName);
if (thingCategoryDef.defName == categoryDef.defName) {
return true;
Expand Down Expand Up @@ -506,20 +509,6 @@ public EquipmentRecord LookupEquipmentRecord(EquipmentKey key) {
}
}

/*
public EquipmentRecord this[EquipmentKey key] {
get {
EquipmentRecord result;
if (entries.TryGetValue(key, out result)) {
return result;
}
else {
return null;
}
}
}
*/

public EquipmentRecord AddThingDefWithStuff(ThingDef def, ThingDef stuff, EquipmentType type) {
if (type == null) {
Log.Warning("Prepare Carefully could not add unclassified equipment: " + def);
Expand Down
Loading

0 comments on commit 28c782e

Please sign in to comment.