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(typeof(StaticConstructorOnStartupUtility), "CallAll")]
[HarmonyPatch] [HarmonyPatch]
static class StaticConstructorOnStartupUtility_CallAll_NonUnoPinataPatch static class StaticConstructorOnStartupUtility_CallAll_ResearchWhateverPatch
{ {
internal static MethodBase TargetMethod() internal static MethodBase TargetMethod()
{ {
@@ -33,13 +33,16 @@ namespace ResearchWhatever
{ {
List<ThingDef> list = new List<ThingDef>( List<ThingDef> list = new List<ThingDef>(
from x in DefDatabase<ThingDef>.AllDefsListForReading 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); select x);
foreach (var thing in list) if (list.NullOrEmpty())
{ return;
thing?.comps.Add(new CompProperties(typeof(ResearchWhateverComp))); 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) static bool Prefix(ref bool __result)
{ {
__result = false; __result = false;
//Log.Message($"ShouldSkip={__result}");
return false; 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; - grammar;
1.0.0 1.0.0