Skip to content

Commit

Permalink
Merge branch 'feature/SwitchToPostfixPatch'
Browse files Browse the repository at this point in the history
  • Loading branch information
CactusPie committed Oct 16, 2021
2 parents 903ad05 + b9d82b1 commit bdbae9e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
14 changes: 12 additions & 2 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
</li>
</modDependencies>
<loadAfter>
<li>syrchalis.individuality</li>
</loadAfter>
<supportedVersions>
<li>1.3</li>
</supportedVersions>
<description>Completely disables romance option for slaves.
Only prevents new romance from occuring, it will not affect any existing romances.
<description>This mod prevents slaves from falling in love.
Only prevents new romance from occurring, it will not affect any existing romances.

Mod settings allow you to enable or disable the following options:
- Prevent slaves from romancing other slaves
- Prevent slaves from romancing colonists

By default both settings are enabled, which means all romance for slaves will be disabled.

Required mod: Harmony.

GitHub: https://github.com/CactusPie/RimWorld-NoSlaveRomance</description>
Expand Down
4 changes: 2 additions & 2 deletions About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>NoSalveRomance</identifier>
<version>1.1</version>
<identifier>NoSlaveRomance</identifier>
<version>1.2</version>
</Manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class DisableSlaveRomancePatch
{
private static readonly NoSlaveRomanceSettings Settings = LoadedModManager.GetMod<NoSlaveRomanceMod>().GetSettings<NoSlaveRomanceSettings>();

private static bool Prefix(ref float __result, Pawn initiator, Pawn recipient)
private static void Postfix(ref float __result, Pawn initiator, Pawn recipient)
{
if (Settings.PreventRomanceWithColonists)
{
Expand All @@ -18,24 +18,21 @@ private static bool Prefix(ref float __result, Pawn initiator, Pawn recipient)
if (initiator.IsSlave || recipient.IsSlave)
{
__result = 0f;
return false;
return;
}
}

if (initiator.IsSlave ^ recipient.IsSlave)
{
__result = 0f;
return false;
return;
}
}

if (Settings.PreventRomanceWithSlaves && initiator.IsSlave && recipient.IsSlave)
{
__result = 0f;
return false;
}

return true;
}
}
}

0 comments on commit bdbae9e

Please sign in to comment.