Skip to content

Commit

Permalink
git commit from PowerShell in C#Doors Expanded Player animals now pro…
Browse files Browse the repository at this point in the history
…perly go to restricted areas that use doors from DoorsExpanded. Prisoners now properly go along with caravaners. Manhunters should not give errors when seeking targets hiding behind doors from Doors Expanded.
  • Loading branch information
jecrell committed Sep 13, 2018
1 parent 89f5568 commit f6ac647
Show file tree
Hide file tree
Showing 17 changed files with 318 additions and 117 deletions.
1 change: 1 addition & 0 deletions About/DiscordURL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://discord.gg/AaVFA7V
1 change: 1 addition & 0 deletions About/LudeonURL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://ludeon.com/forums/index.php?topic=39264.0
1 change: 1 addition & 0 deletions About/PatreonURL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://www.patreon.com/posts/doors-expanded-0-21060058
Binary file added Assemblies/0Harmony.dll
Binary file not shown.
Binary file modified Assemblies/DoorsExpanded.dll
Binary file not shown.
7 changes: 4 additions & 3 deletions Source/.idea/.idea.ProjectHeron/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Source/.idea/.idea.ProjectHeron/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/.idea/.idea.ProjectHeron/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Source/Building_DoorExpanded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,11 @@ public bool SlowsPawns
public virtual bool PawnCanOpen(Pawn p)
{
Lord lord = p.GetLord();
return !forbiddenComp.Forbidden && Def.doorType == DoorType.FreePassage || (lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p)) ||
var result = !forbiddenComp.Forbidden || Def.doorType == DoorType.FreePassage || (lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p)) ||
(p.IsWildMan() && !p.mindState.WildManEverReachedOutside) || base.Faction == null ||
(p.guest != null && p.guest.Released) || GenAI.MachinesLike(base.Faction, p);
if (!result && p.AnimalOrWildMan()) Console.WriteLine(p.def.ToString() + " cannot open " + this.def.ToString());
return result;
}


Expand Down
27 changes: 13 additions & 14 deletions Source/Building_DoorRegionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using RimWorld;
using Verse;
using Verse.AI;
using Verse.AI.Group;
using Verse.Sound;

namespace DoorsExpanded
Expand All @@ -23,19 +24,12 @@ namespace DoorsExpanded
/// </summary>
public class Building_DoorRegionHandler : Building_Door
{


private Building_DoorExpanded parentDoor;

public Building_DoorExpanded ParentDoor
{
get
{
return parentDoor;
}
set
{
parentDoor = value;
}
get { return parentDoor; }
set { parentDoor = value; }
}

public override string LabelMouseover => "";
Expand All @@ -53,7 +47,12 @@ public int TicksUntilClose

public override bool PawnCanOpen(Pawn p)
{
return base.PawnCanOpen(p) && ((p.Faction == this.Faction || !p.Faction.HostileTo(this.Faction)) && !this.IsForbidden(p));
Lord lord = p.GetLord();
if (lord != null && lord.LordJob != null && lord.LordJob.CanOpenAnyDoor(p) ||
(WildManUtility.WildManShouldReachOutsideNow(p) || this.Faction == null ||
p.guest != null && p.guest.Released) || p.AnimalOrWildMan() && p.playerSettings != null)
return true;
return GenAI.MachinesLike(this.Faction, p);
}

public override void Tick()
Expand Down Expand Up @@ -102,7 +101,7 @@ public bool OpenValue
get => Traverse.Create(this).Field("openInt").GetValue<bool>();
set => Traverse.Create(this).Field("openInt").SetValue(value);
}

public void OpenMe(int ticks)
{
this.ticksUntilClose = ticks;
Expand All @@ -126,7 +125,7 @@ public void OpenMe(int ticks)
}
}
}

public override void ExposeData()
{
base.ExposeData();
Expand All @@ -137,4 +136,4 @@ public override void ExposeData()
}*/
}
}
}
}
1 change: 1 addition & 0 deletions Source/DiscordWebhookToken.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://discordapp.com/api/webhooks/487657430256451586/fQfntEHnahggdYmE4db0c0S_xc2MFgzHNyN7nUwIf91LSHqKPKhVi6ixUhkmL7oZf-BJ
Loading

0 comments on commit f6ac647

Please sign in to comment.