diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll
index 4c7463c..9eef3ca 100644
Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ
diff --git a/Common/Defs/RaceGeneDefs/RaceGeneDefs_template.xml b/Common/Defs/RaceGeneDefs/RaceGeneDefs_template.xml
index 29e92c6..20be765 100644
--- a/Common/Defs/RaceGeneDefs/RaceGeneDefs_template.xml
+++ b/Common/Defs/RaceGeneDefs/RaceGeneDefs_template.xml
@@ -18,9 +18,6 @@
For even more direct control you can use pawnKindNames.
- 0
- You can use priority incase you have multiple racegenedefs with the same animal under the same list (racegroup, racenames or pawnKindNames). If not assigned the value is 0. Higher priority is chosen.
-
The RaceGeneDef for an animal will first be decided by if it is in the pawnkindNames, after that racenames and lastly racegroup,
so if there is for a wolf a RaceGeneDef with the canine group and a second which has wolf under raceNames it will always use the second one to determine
which genes can be inherited
diff --git a/Common/Patches/Xenotypes/PatchBiotechNyaron.xml b/Common/Patches/Xenotypes/PatchBiotechNyaron.xml
deleted file mode 100644
index 50ad15f..0000000
--- a/Common/Patches/Xenotypes/PatchBiotechNyaron.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Biotech Nyaron
-
-
- Defs/XenotypeDef[defName="Nyaron"]/genes
-
- rjw_genes_feline_genitalia
-
-
-
-
\ No newline at end of file
diff --git a/Common/Patches/Xenotypes/PatchNarai.xml b/Common/Patches/Xenotypes/PatchNarai.xml
deleted file mode 100644
index 51ee9d8..0000000
--- a/Common/Patches/Xenotypes/PatchNarai.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- NaraiXenotype
-
-
- Defs/XenotypeDef[defName="Narai"]/genes
-
- rjw_genes_canine_genitalia
- rjw_genes_zoophile
-
-
-
-
\ No newline at end of file
diff --git a/Common/Patches/Xenotypes/PatchPapou.xml b/Common/Patches/Xenotypes/PatchPapou.xml
deleted file mode 100644
index 2fbd66b..0000000
--- a/Common/Patches/Xenotypes/PatchPapou.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- Papou Race : emotional birds
-
-
- Defs/XenotypeDef[defName="papago"]/genes
-
- rjw_genes_orgasm_rush
- rjw_genes_damage
- rjw_genes_tight_female_genitalia
- rjw_genes_tight_anus
-
-
-
-
\ No newline at end of file
diff --git a/Common/Patches/Xenotypes/PatchSaurid.xml b/Common/Patches/Xenotypes/PatchSaurid.xml
deleted file mode 100644
index c1fd626..0000000
--- a/Common/Patches/Xenotypes/PatchSaurid.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Vanilla Races Expanded - Saurid
-
-
- Defs/XenotypeDef[defName="VRESaurids_Saurid"]/genes
-
- rjw_genes_dragon_genitalia
-
-
-
-
\ No newline at end of file
diff --git a/KNOWN_BUGS.md b/KNOWN_BUGS.md
index 904d9a0..3fe7439 100644
--- a/KNOWN_BUGS.md
+++ b/KNOWN_BUGS.md
@@ -48,7 +48,7 @@ RimWorld.GeneMaker:MakeGene (Verse.GeneDef,Verse.Pawn)
Reason:
-RJW covers some corner cases when the pawn is changed before creation. This seems a bit legacy and related to Royalty-Content.
+RJW covers some corner cases when the pawn is changed before creation.
Current Solution:
@@ -56,25 +56,10 @@ Ignore this. The pawns seem to have the right sex and genitalia, I cannot "catch
Aimed Solution:
-Patch RJW ChangeSex upstream to skip for pawns with the two genes producing this.
-
-## Error on Game Load: Verse.GeneDef named rjw_genes_human_genitalia (wanter=genes)
-
-Error: Issue #4, Game throws a warning on load that some Genes were not found.
-
-Reason: (Likely) because I removed some genes from Pre-Release to 1.0.0. Now some players have unknown definitions in their safe-files and Xenotype Defs.
-The removed Genes were the ones that performed default behaviour (e.g. normal breast size, normal penis size, ...)
-
-Solution: Should be safe to ignore, when you get this on safe-load make a quick new safe. new safe should not throw the error. For Self-Made Xenotypes remove the Genes.
-
-Sorry about this one, I know removal can break things but hey you were playing with the Prerelease!
+Patch ChangeSex to skip for pawns with the two genes producing this.
## Insect Breeder does not fertilize
-Update:
-
-We changed behaviour in [1.0.1](https://github.com/vegapnk/RJW-Genes/releases/tag/1.0.1) and it seems to work now. Please tell us if you still encounter this.
-
Error:
A pawn with insect breeder fucks a pawn with unfertilized insect eggs, but the eggs stay unfertilized.
@@ -86,4 +71,4 @@ So testing this is super hard.
One thing - you need to have anal or vaginal sex for this to work. Any other sex type is currently not supported.
-For anything else, please help me gather information on this what you did and how things look. I reworked it once but I think it should work now.
+For anything else, please help me gather information on this what you did and how things look. I reworked it once but I think it should work now.
\ No newline at end of file
diff --git a/Source/Animal_Inheritance/InheritanceUtility.cs b/Source/Animal_Inheritance/InheritanceUtility.cs
index 1996589..2b260dd 100644
--- a/Source/Animal_Inheritance/InheritanceUtility.cs
+++ b/Source/Animal_Inheritance/InheritanceUtility.cs
@@ -42,7 +42,7 @@ namespace RJW_BGS
public static List SelectGenes(Pawn pawn)
{
List genelist = new List();
- RaceGeneDef raceGeneDef = RaceGeneDef_Helper.GetRaceGeneDefInternal(pawn);
+ RaceGeneDef raceGeneDef = RJWcopy.GetRaceGeneDefInternal(pawn);
if (raceGeneDef != null)
{
foreach (BestialityGeneInheritanceDef gene in raceGeneDef.genes)
diff --git a/Source/Animal_Inheritance/RaceGeneDef.cs b/Source/Animal_Inheritance/RaceGeneDef.cs
index 02ac62d..c4cbcea 100644
--- a/Source/Animal_Inheritance/RaceGeneDef.cs
+++ b/Source/Animal_Inheritance/RaceGeneDef.cs
@@ -10,7 +10,7 @@ namespace RJW_BGS
{
public class RaceGeneDef : Def
{
- public int priority;
+
public String raceGroup;
public List raceNames;
public List pawnKindNames;
diff --git a/Source/Animal_Inheritance/RaceGeneDef_Helper.cs b/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
index 680b155..ed6541a 100644
--- a/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
+++ b/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
@@ -9,48 +9,31 @@ using RimWorld;
namespace RJW_BGS
{
- public class RaceGeneDef_Helper
+ internal class RJWcopy
{
//code based on racegroupdefinternal which has a similar function
public static RaceGeneDef GetRaceGeneDefInternal(Pawn pawn)
{
- List Valids = ValidRaceGeneDefs(pawn);
- if (Valids.Count > 0)
- {
- RaceGeneDef result = Valids.MaxBy(r => r.priority);
- return result;
- }
- return null;
- //First check if there is a matching pawnkinddef then race, then racegroup
-
- }
- public static List ValidRaceGeneDefs(Pawn pawn)
- {
PawnKindDef kindDef = pawn.kindDef;
if (kindDef == null)
- {
+ {
return null;
- }
+ }
string raceName = kindDef.race.defName;
string pawnKindName = kindDef.defName;
+ IEnumerable allDefs = DefDatabase.AllDefs;
PawnData pawnData = SaveStorage.DataStore.GetPawnData(pawn);
RaceGroupDef raceGroupDef = pawnData.RaceSupportDef;
-
- IEnumerable allDefs = DefDatabase.AllDefs;
List pawnKindDefs = allDefs.Where(delegate (RaceGeneDef group)
{
List pawnKindNames = group.pawnKindNames;
return pawnKindNames != null && pawnKindNames.Contains(pawnKindName);
}).ToList();
- if (pawnKindDefs.Count() > 0)
- return pawnKindDefs;
List raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
{
List raceNames = group.raceNames;
return raceNames != null && raceNames.Contains(raceName);
}).ToList();
- if (raceKindDefs.Count() > 0)
- return raceKindDefs;
List raceGroupDefs = new List();
if (raceGroupDef != null)
{
@@ -60,9 +43,27 @@ namespace RJW_BGS
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
}).ToList();
}
- if (raceGroupDefs.Count() > 0)
- return raceGroupDefs;
- return new List();
+ RaceGeneDef result = null;
+ //First check if there is a matching pawnkinddef then race, then racegroup
+ if (pawnKindDefs.Any())
+ {
+ result = pawnKindDefs.RandomElement();
+ }
+ else if (raceKindDefs.Any() && result == null)
+ {
+ result = raceKindDefs.RandomElement();
+ }
+ else if (raceGroupDefs.Any() && result == null)
+ {
+ result = raceGroupDefs.RandomElement();
+ }
+ else
+ {
+ result = null;
+ }
+ return result;
+
+
}
}
}
diff --git a/Source/Genes/GenitaliaSize/SizeAdjuster.cs b/Source/Genes/GenitaliaSize/SizeAdjuster.cs
index 6a67dcd..e87f490 100644
--- a/Source/Genes/GenitaliaSize/SizeAdjuster.cs
+++ b/Source/Genes/GenitaliaSize/SizeAdjuster.cs
@@ -58,7 +58,7 @@ namespace RJW_Genes
public static void AdjustAllBreastSizes(Pawn pawn, float lowerLimit = 0.0f, float upperLimit = 1.0f)
{
- List AllBreasts = Genital_Helper.get_AllPartsHediffList(pawn).FindAll(x => x.def.defName.ToLower().Contains("breasts"));
+ List AllBreasts = Genital_Helper.get_AllPartsHediffList(pawn).FindAll(x => x.def.defName.Contains("breasts"));
ResizeAll(AllBreasts,lowerLimit,upperLimit);
}