Skip to content

Commit f4bc917

Browse files
committed
Fix crash for new ONI release
1 parent ad8b8d0 commit f4bc917

8 files changed

+50
-9
lines changed

src/Patches/StartingBasePatch.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.Linq;
66
using TemplateClasses;
7+
using static ProcGenGame.TemplateSpawning;
78

89
namespace SurvivalNotRequired.Patches
910
{
@@ -18,7 +19,7 @@ public static class StartingBasePatch
1819
/// <summary>
1920
/// Postfix for <see cref="TemplateSpawning.DetermineTemplatesForWorld"/>.
2021
/// </summary>
21-
public static void Postfix(WorldGenSettings settings, ref List<KeyValuePair<Vector2I, TemplateContainer>> __result)
22+
public static void Postfix(WorldGenSettings settings, ref List<TemplateSpawner> __result)
2223
{
2324
// make sure that the templates won't be patched twice
2425
if (_templatesPatched || string.IsNullOrEmpty(settings.world.startingBaseTemplate))
@@ -29,8 +30,8 @@ public static void Postfix(WorldGenSettings settings, ref List<KeyValuePair<Vect
2930
// iterate through every template containing a headquarter
3031
// assume this is the starting base template
3132
foreach (var templateContainer in __result
32-
.Where(t => t.Value?.buildings != null && t.Value.buildings.Any(b => b.id == HeadquartersConfig.ID))
33-
.Select(t => t.Value))
33+
.Where(t => t.container.buildings != null && t.container.buildings.Any(b => b.id == HeadquartersConfig.ID))
34+
.Select(t => t.container))
3435
{
3536
var headquarters = templateContainer.buildings.Single(b => b.id == HeadquartersConfig.ID);
3637

src/SurvivalNotRequired.CodeSigning.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<!-- Code sign assemblies -->
44
<Target Name="CodeSignAssembliesBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='ReleaseSigned'">
5-
<Exec Command="cd $(OutDir)&#xD;&#xA;for /f &quot;delims=|&quot; %%a in ('dir /s /b *.dll *.exe') do &quot;$(SignToolPath)signtool.exe&quot; sign /n &quot;$(SignSubjectName)&quot; /t &quot;$(SignTimestampServerUrl)&quot; /fd certHash ^&quot;%%a^&quot;" />
5+
<Exec Command="powershell &quot;cd $(OutDir); &amp;'$(SignToolPath)signtool.exe' sign /n '$(SignSubjectName)' /t '$(SignTimestampServerUrl)' /fd certHash /v ((Get-ChildItem -Include ('*.dll', '*.exe') -Recurse . | select -ExpandProperty FullName | ForEach-Object {'\&quot;' + $_ + '\&quot;\&quot;'}) -join ' ')&quot;" />
66
</Target>
77

88
<Target Name="CodeSignAssembliesPublish" AfterTargets="Publish" Condition="'$(Configuration)'=='ReleaseSigned'">
9-
<Exec Command="cd $(PublishDir)&#xD;&#xA;for /f &quot;delims=|&quot; %%a in ('dir /s /b *.dll *.exe') do &quot;$(SignToolPath)signtool.exe&quot; sign /n &quot;$(SignSubjectName)&quot; /t &quot;$(SignTimestampServerUrl)&quot; /fd certHash ^&quot;%%a^&quot;" />
9+
<Exec Command="powershell &quot;cd $(PublishDir); &amp;'$(SignToolPath)signtool.exe' sign /n '$(SignSubjectName)' /t '$(SignTimestampServerUrl)' /fd certHash /v ((Get-ChildItem -Include ('*.dll', '*.exe') -Recurse . | select -ExpandProperty FullName | ForEach-Object {'\&quot;' + $_ + '\&quot;\&quot;'}) -join ' ')&quot;" />
1010
</Target>
1111
</Project>

src/SurvivalNotRequired.csproj

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<PropertyGroup>
44
<TargetFramework>net471</TargetFramework>
55
<AssemblyOriginatorKeyFile>SurvivalNotRequired.snk</AssemblyOriginatorKeyFile>
6-
<Configurations>Debug;Release;ReleaseSigned;ReleaseSigned</Configurations>
7-
<Version>1.1.4</Version>
6+
<Configurations>Debug;Release;ReleaseSigned</Configurations>
7+
<Version>1.1.5</Version>
88
</PropertyGroup>
99

1010
<!-- C# compiler -->
@@ -31,6 +31,10 @@
3131
<None Remove="archived_versions\all_514967\mod_info.yaml" />
3232
<None Remove="archived_versions\all_514967\settings.yaml" />
3333
<None Remove="archived_versions\all_514967\SurvivalNotRequired.dll" />
34+
<None Remove="archived_versions\all_525812\mod.yaml" />
35+
<None Remove="archived_versions\all_525812\mod_info.yaml" />
36+
<None Remove="archived_versions\all_525812\settings.yaml" />
37+
<None Remove="archived_versions\all_525812\SurvivalNotRequired.dll" />
3438
<None Remove="mod.yaml" />
3539
<None Remove="mod_info.yaml" />
3640
<None Remove="settings.yaml" />
@@ -49,6 +53,18 @@
4953
<Content Include="archived_versions\all_514967\SurvivalNotRequired.dll">
5054
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5155
</Content>
56+
<Content Include="archived_versions\all_525812\mod.yaml">
57+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
58+
</Content>
59+
<Content Include="archived_versions\all_525812\mod_info.yaml">
60+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
61+
</Content>
62+
<Content Include="archived_versions\all_525812\settings.yaml">
63+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
64+
</Content>
65+
<Content Include="archived_versions\all_525812\SurvivalNotRequired.dll">
66+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
67+
</Content>
5268
<Content Include="settings.yaml">
5369
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
5470
</Content>
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: "Survival Not Required"
2+
description: "Survival just got a little more probable."
3+
staticID: "SurvivalNotRequiredMod"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
supportedContent: ALL
2+
minimumSupportedBuild: 525812
3+
version: 1.1.4
4+
APIVersion: 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# the dispensed oxygen temperature will be the minimum of the Printing Pod and this setting
2+
oxygenMinTemperatureInKelvin: 293.15
3+
4+
# how much oxygen is dispensed per second (the output must be unblocked)
5+
oxygenOutputInKgPerSecond: 0.5
6+
7+
# how much power is provided
8+
wattageRating: 400.0
9+
10+
# the amount of dispensed heat when the Printing Pod is active (1.0 is equal to 1,000 DTU/s)
11+
selfHeatKilowattsWhenActive: 1.0
12+
13+
# whether the Mini-Pod should be extended just like the Printing Pod
14+
extendMiniPod: true
15+
16+
# the storage capacity (for oxygen) of the Printing Pod
17+
capacityInKg: 10.0

src/mod_info.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
supportedContent: ALL
2-
minimumSupportedBuild: 525812
3-
version: 1.1.4
2+
minimumSupportedBuild: 550759
3+
version: 1.1.5
44
APIVersion: 2

0 commit comments

Comments
 (0)