Skip to content

Commit

Permalink
Monument Marker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Aug 5, 2021
1 parent 96e6e4d commit b4ded6a
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 8 deletions.
Binary file modified 1.3/Assemblies/Vampire.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<li>jecrell.jecstools</li>
<li>Dubwise.DubsBadHygiene</li>
</loadAfter>
<description>1.23.0.0 (07-29-2021)
<description>1.23.0.1 (08-04-2021)

Adds vampires to RimWorld.

Expand All @@ -49,6 +49,10 @@ Michael Cailler, Jigsawjohn , Daniel Schott, Penelope Charli Whitman, Jerome Gon
========================
Changelog
========================
1.23.0.1 (08-04-2021)
========================
Monument Markers with Sarcophagi inside will no longer fail to complete being built.

1.23.0.0 (07-29-2021)
========================
Added support for RimWorld 1.3. Renounce title and execute no longer block the Vampirism icon.
Expand Down
4 changes: 4 additions & 0 deletions About/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.23.0.1 (08-04-2021)
========================
Monument Markers with Sarcophagi inside will no longer fail to complete being built.

1.23.0.0 (07-29-2021)
========================
Added support for RimWorld 1.3. Renounce title and execute no longer block the Vampirism icon.
Expand Down
2 changes: 1 addition & 1 deletion 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>RimOfMadness-Vampires</identifier>
<version>1.23.0.0</version>
<version>1.23.0.1</version>
<dependencies>
<li>jecrell.jecstools</li>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion About/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.0.0
1.23.0.1
53 changes: 53 additions & 0 deletions Source/Vampires/HarmonyPatches/HarmonyPatches_Royalty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,62 @@ public static void HarmonyPatches_Royalty(Harmony harmony)
harmony.Patch(AccessTools.Method(typeof(JoyGiver_SocialRelax), "TryFindIngestibleToNurse"), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(VampsCanDrinkBloodWineNotHumans)));

//Allow the monument maker to have sarcophagus and coffins by fixing the sleeping spot error
harmony.Patch(AccessTools.Property(typeof(MonumentMarker), nameof(MonumentMarker.FirstDisallowedBuilding)).GetGetMethod(), null,
new HarmonyMethod(typeof(HarmonyPatches), nameof(VampExceptionsForMonumentMarkers)));


}
public static void VampExceptionsForMonumentMarkers(MonumentMarker __instance, ref Thing __result)
{
if (__result?.def?.defName == "ROMV_SarcophagusBed")
{
//Log.ErrorOnce("VampExceptionTriggered", 828676);
if (!__instance.Spawned)
{
__result = null;
return;
}
List<SketchTerrain> terrain = __instance.sketch.Terrain;
for (int i = 0; i < terrain.Count; i++)
{
var tmpAllowedBuildings = (List<ThingDef>)AccessTools.Field(typeof(MonumentMarker), "tmpAllowedBuildings").GetValue(__instance);
tmpAllowedBuildings.Clear();
SketchThing sketchThing;
List<SketchThing> list;
__instance.sketch.ThingsAt(terrain[i].pos, out sketchThing, out list);

//Add sarcophagus sleep spot
tmpAllowedBuildings.Add(__result.def);

if (sketchThing != null)
{
tmpAllowedBuildings.Add(sketchThing.def);
}
if (list != null)
{
for (int j = 0; j < list.Count; j++)
{
tmpAllowedBuildings.Add(list[j].def);
}
}
List<Thing> thingList = (terrain[i].pos + __instance.Position).GetThingList(__instance.Map);
for (int k = 0; k < thingList.Count; k++)
{
if (thingList[k].def.IsBuildingArtificial && !thingList[k].def.IsBlueprint && !thingList[k].def.IsFrame && !tmpAllowedBuildings.Contains(thingList[k].def))
{
__result = thingList[k];
return;
}
}
}
__result = null;
return;
}
}



//JoyGiver_SocialRelax.TryFindIngestibleToNurse
public static void VampsCanDrinkBloodWineNotHumans(JoyGiver_SocialRelax __instance, IntVec3 center, Pawn ingester, ref Thing ingestible, ref bool __result)
{
Expand Down
10 changes: 5 additions & 5 deletions updateinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
==============================

Rim of Madness - Vampires Update
v1.20.0.1 (10-26-2018)
v1.23.0.0 (07-29-2021)
====================

Blood packs can now be transferred to pawns who need them. Fixed vitae addiction text. Fixed interaction text issues. Added extra diablerie warnings and information to conceptdefs.
Added support for RimWorld 1.3. Renounce title and execute no longer block the Vampirism icon.
--------------------

Download now on...
Expand All @@ -25,9 +25,9 @@ Discuss the mod on...
[img width=260]https://raw.githubusercontent.com/Rim-Of-Madness-Team/Rim-of-Madness---Vampires/master/About/Preview.png[/img]
[hr]
[b]Rim of Madness - Vampires
Version: 1.20.0.1
Updated: 10-26-2018
Description: [color=orange]Blood packs can now be transferred to pawns who need them. Fixed vitae addiction text. Fixed interaction text issues. Added extra diablerie warnings and information to conceptdefs.[/color]
Version: 1.23.0.0
Updated: 07-29-2021
Description: [color=orange]Added support for RimWorld 1.3. Renounce title and execute no longer block the Vampirism icon.[/color]
[hr]
[b]Download now on...[/b]
[url=https://www.patreon.com/posts/22142186]Patreon[/url]
Expand Down

0 comments on commit b4ded6a

Please sign in to comment.