This commit is contained in:
CGFighter
2021-07-31 01:07:20 +03:00
parent 378035e8d2
commit 27ce46c551
4 changed files with 13 additions and 8 deletions

View File

Binary file not shown.

View File

@@ -13,7 +13,7 @@ namespace ResearchWhatever
{
//[HarmonyPatch(typeof(StaticConstructorOnStartupUtility), "CallAll")]
[HarmonyPatch]
static class StaticConstructorOnStartupUtility_CallAll_NonUnoPinataPatch
static class StaticConstructorOnStartupUtility_CallAll_ResearchWhateverPatch
{
internal static MethodBase TargetMethod()
{
@@ -33,13 +33,16 @@ namespace ResearchWhatever
{
List<ThingDef> list = new List<ThingDef>(
from x in DefDatabase<ThingDef>.AllDefsListForReading
where x.thingClass == typeof(Building_ResearchBench) || x.thingClass.IsSubclassOf(typeof(Building_ResearchBench))
where x.thingClass == typeof(Building_ResearchBench) || x.thingClass != null && x.thingClass.IsSubclassOf(typeof(Building_ResearchBench))
select x);
foreach (var thing in list)
{
thing?.comps.Add(new CompProperties(typeof(ResearchWhateverComp)));
}
if (list.NullOrEmpty())
return;
else
foreach (var thing in list)
{
thing?.comps?.Add(new CompProperties(typeof(ResearchWhateverComp)));
}
}
}
}

View File

@@ -13,7 +13,6 @@ namespace ResearchWhatever.Patches
static bool Prefix(ref bool __result)
{
__result = false;
//Log.Message($"ShouldSkip={__result}");
return false;
}
}

View File

@@ -1,4 +1,7 @@
1.0.0.1
1.0.1
- did stuff that maybe could help somebody;
1.0.0.1
- grammar;
1.0.0