Skip to content

Commit

Permalink
v1.0.7
Browse files Browse the repository at this point in the history
- Fixed possible null reference with non-vanilla pawn types
- Fixed erroneous "not allowed artisan builds" tooltip
  • Loading branch information
Jaxe-Wilde committed Sep 4, 2018
1 parent 2e6a31b commit eb869e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion About/ModSync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ModSyncNinjaData>
<ID>59f538ed-f86d-4506-a4a5-7e9faaa37508</ID>
<ModName>Pawn Rules</ModName>
<Version>v1.0.6</Version>
<Version>v1.0.7</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>Jaxe-Dev</Owner>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pawn Rules
![](https://img.shields.io/badge/Version-1.0.6-brightgreen.svg)
![](https://img.shields.io/badge/Version-1.0.7-brightgreen.svg)

Built for **RimWorld B19**\
Powered by **Harmony**\
Expand Down
4 changes: 2 additions & 2 deletions Source/Data/RestrictionTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ private static RestrictionTemplate GetAnimalsCategorized(Restriction restriction
string category;

if (animal.RaceProps.petness > 0.5f) { category = categories[0]; }
else if (animal.race.tradeTags.Contains("AnimalFarm")) { category = categories[1]; }
else if (animal.race.tradeTags?.Contains("AnimalFarm") ?? false) { category = categories[1]; }
else if (animal.RaceProps.herdAnimal) { category = categories[2]; }
else if (animal.RaceProps.predator) { category = categories[3]; }
else if (animal.race.tradeTags.Contains("AnimalInsect")) { category = categories[4]; }
else if (animal.race.tradeTags?.Contains("AnimalInsect") ?? false) { category = categories[4]; }
else { category = categories[5]; }

if (!list.ContainsKey(category)) { list[category] = new Category(category); }
Expand Down
2 changes: 1 addition & 1 deletion Source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ internal class Mod : Verse.Mod
public const string Id = "PawnRules";
public const string Name = "Pawn Rules";
public const string Author = "Jaxe";
public const string Version = "1.0.6";
public const string Version = "1.0.7";

public static ModContentPack ContentPack { get; private set; }

Expand Down
2 changes: 2 additions & 0 deletions Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ private static void Postfix(ref bool __result, Thing t, Pawn p, bool checkConstr
{
if (!Registry.IsActive) { return; }

if (__result == false) { return; }

var rules = Registry.GetRules(p);
if (!checkConstructionSkill || (rules == null) || rules.AllowArtisan || !((ThingDef) t.def.entityDefToBuild).HasComp(typeof(CompQuality)))
{
Expand Down

0 comments on commit eb869e4

Please sign in to comment.