Skip to content

Commit

Permalink
v1.1.5
Browse files Browse the repository at this point in the history
- Fix for non-artisan's trying to build non-objects (such as floors)
  • Loading branch information
Jaxe-Dev committed Sep 24, 2018
1 parent 819e0d2 commit 13a3b2a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<name>Pawn Rules</name>
<author>Jaxe</author>
<targetVersion>0.19.0</targetVersion>
<description>Mod Version: 1.1.4\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.</description>
<description>Mod Version: 1.1.5\n\n\nPawn Rules is a mod that allows custom rules to be assigned individually to your colonists, animals, guests and prisoners.\n\nCurrently the following rules can be applied:\n\n- Disallow certain foods\n- Disallow bonding with certain animals\n- Disallow new romances\n- Disallow constructing items that have a quality level\n\nAny of these rules can be disabled and hidden from the rules window. Rules presets and defaults can be imported and exported between games.</description>
<url>https://github.com/Jaxe-Dev/PawnRules</url>
</ModMetaData>
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.1.4</Version>
<Version>v1.1.5</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Github">
<Owner>Jaxe-Dev</Owner>
Expand Down
Binary file modified About/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/Mod_Version-1.1.4-blue.svg)
![](https://img.shields.io/badge/Mod_Version-1.1.5-blue.svg)
![](https://img.shields.io/badge/Built_for_RimWorld-B19-blue.svg)
![](https://img.shields.io/badge/Powered_by_Harmony-1.2.0.1-blue.svg)

Expand Down
2 changes: 1 addition & 1 deletion Source/Data/Registry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class Registry : WorldObject
private const string WorldObjectDefName = "PawnRules_Registry";
private const string CurrentVersion = "v" + Mod.Version;

public static bool IsActive => !_isDeactivating && (_instance != null) && (Find.GameInitData.playerFaction != null);
public static bool IsActive => !_isDeactivating && (_instance != null) && (Current.ProgramState == ProgramState.Playing);

private static Registry _instance;

Expand Down
3 changes: 1 addition & 2 deletions Source/Integration/RimHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public static string GetRulesInfo(Pawn pawn)
var rules = Registry.GetRules(pawn);
if (rules == null) { return null; }

var name = rules.IsPreset ? rules.Name : Lang.Get("Preset.Personalized");
return name;
return rules.IsPreset ? rules.Name : Lang.Get("Preset.Personalized");
}
}
}
2 changes: 1 addition & 1 deletion Source/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class Mod : Verse.Mod
{
public const string Id = "PawnRules";
public const string Name = "Pawn Rules";
public const string Version = "1.1.4";
public const string Version = "1.1.5";

public static readonly DirectoryInfo ConfigDirectory = new DirectoryInfo(Path.Combine(GenFilePaths.ConfigFolderPath, Id));

Expand Down
4 changes: 3 additions & 1 deletion Source/Patch/RimWorld_GenConstruct_CanConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ private static void Postfix(ref bool __result, Thing t, Pawn p, bool checkConstr
if (!Registry.IsActive || (__result == false)) { return; }

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

if (!(t.def.entityDefToBuild is ThingDef thingDef) || !thingDef.HasComp(typeof(CompQuality))) { return; }

if (forced && !JobFailReason.HaveReason && !rules.AllowArtisan) { JobFailReason.Is(Lang.Get("Rules.NotArtisanReason"), Lang.Get("Rules.NotArtisanJob", t.LabelCap)); }

Expand Down

0 comments on commit 13a3b2a

Please sign in to comment.