Skip to content

Commit

Permalink
Merge branch 'master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Jul 1, 2023
2 parents ad00f4f + 93d82c2 commit 0e529d7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 108 deletions.
8 changes: 8 additions & 0 deletions CLA/Signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
"created_at": "2023-06-27T22:17:50Z",
"repoId": 123711758,
"pullRequestNo": 391
},
{
"name": "jonahnm",
"id": 61718056,
"comment_id": 1616061135,
"created_at": "2023-07-01T19:37:09Z",
"repoId": 123711758,
"pullRequestNo": 426
}
]
}
64 changes: 0 additions & 64 deletions Nautilus/Handlers/EatableHandler.cs

This file was deleted.

1 change: 0 additions & 1 deletion Nautilus/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public class Initializer : BaseUnityPlugin
TooltipPatcher.Patch(_harmony);
SurvivalPatcher.Patch(_harmony);
CustomSoundPatcher.Patch(_harmony);
EatablePatcher.Patch(_harmony);
MaterialUtils.Patch();
FontReferencesPatcher.Patch(_harmony);
VehicleUpgradesPatcher.Patch(_harmony);
Expand Down
36 changes: 0 additions & 36 deletions Nautilus/Patchers/EatablePatcher.cs

This file was deleted.

14 changes: 7 additions & 7 deletions Nautilus/Patchers/VehicleUpgradesPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private static void OnModuleChangeDelegate(Vehicle __instance, int slotID, TechT
private static void OnModuleChangeCrushDepth(Vehicle __instance, int slotID, TechType techType, bool added)
{
Dictionary<TechType, float> CrushDepthUpgrades = new();
if(__instance is Exosuit)
if (__instance is Exosuit)
ExosuitUpgradeModules.DoIf(
(KeyValuePair<TechType, ICustomPrefab> mapElem) => mapElem.Value.TryGetGadget(out UpgradeModuleGadget moduleGadget) && moduleGadget.CrushDepth > 0f,
(KeyValuePair<TechType, ICustomPrefab> mapElem) => CrushDepthUpgrades.Add(mapElem.Key, mapElem.Value.GetGadget<UpgradeModuleGadget>().CrushDepth)
Expand All @@ -88,7 +88,7 @@ private static void OnModuleChangeCrushDepth(Vehicle __instance, int slotID, Tec
if (crushDepthToCheck > newCrushDepth)
{
newCrushDepth = crushDepthToCheck;
if(__instance is Exosuit)
if (__instance is Exosuit)
{
if (ExosuitUpgradeModules[techTypeInSlot].TryGetGadget(out UpgradeModuleGadget moduleGadget))
absolute = moduleGadget.AbsoluteDepth;
Expand Down Expand Up @@ -239,7 +239,7 @@ private static void OnUpgradeModuleExoHull(Exosuit __instance, int slotID, TechT
if (Exosuit.crushDepths.TryGetValue(techTypeInSlot, out depthToCheck) && depthToCheck > newCrushDepth)
{
newCrushDepth = depthToCheck;
if (ExosuitUpgradeModules[techTypeInSlot].TryGetGadget(out UpgradeModuleGadget mdlGadget))
if (ExosuitUpgradeModules.TryGetValue(techTypeInSlot, out var gadget) && gadget.TryGetGadget(out UpgradeModuleGadget mdlGadget))
absolute = mdlGadget.AbsoluteDepth;
}
}
Expand Down Expand Up @@ -331,7 +331,7 @@ private static void SeamothOnUpgradeModuleHull(SeaMoth __instance, int slotID, T
if (crushDepthToCheck > newCrushDepth)
{
newCrushDepth = crushDepthToCheck;
if(SeamothUpgradeModules[techTypeInSlot].TryGetGadget(out UpgradeModuleGadget moduleGadget))
if (SeamothUpgradeModules.TryGetValue(techTypeInSlot, out var gadget) && gadget.TryGetGadget(out UpgradeModuleGadget moduleGadget))
absolute = moduleGadget.AbsoluteDepth;
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ public static void SeamothDelegateUse(SeaMoth __instance, ref float cooldown, in
moduleGadget.delegateOnUsed?.Invoke(__instance, slotID, quickSlotCharge, chargeScalar);

if (moduleGadget.Cooldown > 0f)
cooldown = (float)moduleGadget.Cooldown;
cooldown = (float) moduleGadget.Cooldown;
}

[HarmonyTranspiler]
Expand All @@ -386,7 +386,7 @@ private static IEnumerable<CodeInstruction> OnUpgradeModuleUse(IEnumerable<CodeI
Transpilers.EmitDelegate(SeamothDelegateUse)
);

return matcher.InstructionEnumeration();
return matcher.InstructionEnumeration();
}


Expand Down Expand Up @@ -468,7 +468,7 @@ private static void OnUpgradeChangeDelegate(SeaTruckUpgrades __instance, int slo
if (SeaTruckUpgrades.crushDepths.TryGetValue(techTypeInSlot, out depthToCheck) && depthToCheck > newCrushDepth)
{
newCrushDepth = depthToCheck;
if (SeatruckUpgradeModules[techTypeInSlot].TryGetGadget(out UpgradeModuleGadget mdlGadget))
if (SeatruckUpgradeModules.TryGetValue(techTypeInSlot, out var gadget) && gadget.TryGetGadget(out UpgradeModuleGadget mdlGadget))
absolute = mdlGadget.AbsoluteDepth;
}
}
Expand Down

0 comments on commit 0e529d7

Please sign in to comment.