Skip to content

Commit

Permalink
ScanningGadget now always adds the analysis tech entry to the current…
Browse files Browse the repository at this point in the history
… techtype
  • Loading branch information
Metious committed Sep 27, 2023
1 parent 28ce0bc commit 95d47bb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Nautilus/Assets/Gadgets/ScanningGadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ public ScanningGadget WithAnalysisTech(
)
{
AnalysisTech ??= new KnownTech.AnalysisTech();
AnalysisTech.techType = RequiredForUnlock != TechType.None
? RequiredForUnlock
: prefab.Info.TechType;
AnalysisTech.techType = prefab.Info.TechType;
AnalysisTech.unlockTechTypes = RequiredForUnlock != TechType.None
? new() { prefab.Info.TechType }
: new();
Expand Down Expand Up @@ -347,13 +345,13 @@ protected internal override void Build()
PDAHandler.AddCustomScannerEntry(ScannerEntryData);
}

if (CompoundTechsForUnlock is { Count: > 0 } || RequiredForUnlock != TechType.None)
if (RequiredForUnlock != TechType.None)
{
if (AnalysisTech is null && RequiredForUnlock != TechType.None)
{
KnownTechHandler.SetAnalysisTechEntry(RequiredForUnlock, new[] { prefab.Info.TechType }, KnownTechHandler.DefaultUnlockData.BlueprintUnlockMessage, KnownTechHandler.DefaultUnlockData.BlueprintUnlockSound);
}
KnownTechHandler.AddRequirementForUnlock(prefab.Info.TechType, RequiredForUnlock);
}

if (CompoundTechsForUnlock is { Count: > 0 } || RequiredForUnlock != TechType.None)
{
KnownTechPatcher.UnlockedAtStart.Remove(prefab.Info.TechType);
}

Expand Down

0 comments on commit 95d47bb

Please sign in to comment.