diff --git a/SCHIZO/Creatures/Components/CarryCreature.cs b/SCHIZO/Creatures/Components/CarryCreature.cs index 453d22c7..5bfce9ba 100644 --- a/SCHIZO/Creatures/Components/CarryCreature.cs +++ b/SCHIZO/Creatures/Components/CarryCreature.cs @@ -1,5 +1,4 @@ using System.Collections; -using SCHIZO.Helpers; using UnityEngine; namespace SCHIZO.Creatures.Components; @@ -203,12 +202,12 @@ private void RepositionTarget() targetTransform.localPosition = Vector3.zero; // place the transform so the plug is exactly on the socket Vector3 offset = Vector3.zero; - + if (target.attachPlug) { offset = attachSocket.InverseTransformPoint(target.attachPlug.position); } - + targetTransform.localPosition = -offset; } diff --git a/SCHIZO/Creatures/Ermfish/ErmStack.cs b/SCHIZO/Creatures/Ermfish/ErmStack.cs index 00258f05..3424c579 100644 --- a/SCHIZO/Creatures/Ermfish/ErmStack.cs +++ b/SCHIZO/Creatures/Ermfish/ErmStack.cs @@ -65,7 +65,7 @@ public void StartStacking() { ErmStack target = FindTarget(); if (!target || target == this) return; - + socket.SetTarget(target.plug); } @@ -94,8 +94,7 @@ ErmStack FindNearest_TechType() .OfTechType(selfTechType) .OrderByDistanceTo(gameObject.transform.position) .SelectComponentInParent() - .Where(s => !s.nextSocket && s != this) - .FirstOrDefault(); + .FirstOrDefault(s => !s.nextSocket && s != this); } } @@ -133,7 +132,7 @@ public static void Disconnect(ErmStack node, bool plugSide = true) } else { - socket = node.nextSocket?.socket ?? node.socket; + socket = node.nextSocket ? node.nextSocket.socket : node.socket; } socket.Drop(); } @@ -149,6 +148,7 @@ public bool ShouldAttach(Carryable plug, CarryCreature socket) return socketStack.head != head && socketStack.tail != tail && !socketStack.nextPlug; } + public void OnConnected(Carryable plug, CarryCreature socket) { // only called on the plug side - so we update the socket from the plug diff --git a/SCHIZO/Items/ClonePrefab.cs b/SCHIZO/Items/ClonePrefab.cs index e607f8bc..3e04e03b 100644 --- a/SCHIZO/Items/ClonePrefab.cs +++ b/SCHIZO/Items/ClonePrefab.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using Nautilus.Assets.PrefabTemplates; using UnityEngine; @@ -11,16 +10,11 @@ public abstract class ClonePrefab : UnityPrefab [SetsRequiredMembers] protected ClonePrefab(ModItem item, TechType cloned) : base(item) + // ReSharper disable once ConvertToPrimaryConstructor { clonedTechType = cloned; } - [Obsolete("This method is not supported on ClonePrefab.", true)] - public new static void CreateAndRegister(ModItem item) - { - throw new NotSupportedException(); - } - protected sealed override NautilusPrefabConvertible GetPrefab() { return new CloneTemplate(ModItem, clonedTechType) diff --git a/SCHIZO/Resources/AssetBundles/Assets.cs b/SCHIZO/Resources/AssetBundles/Assets.cs index 24b32fed..356c6432 100644 --- a/SCHIZO/Resources/AssetBundles/Assets.cs +++ b/SCHIZO/Resources/AssetBundles/Assets.cs @@ -12,7 +12,7 @@ namespace SCHIZO.Resources; public static class Assets { - private const int _rnd = 1215340893; + private const int _rnd = 88235459; private static readonly UnityEngine.AssetBundle _a = ResourceManager.GetAssetBundle("assets"); diff --git a/SCHIZO/Resources/AssetBundles/assets b/SCHIZO/Resources/AssetBundles/assets index cb21ca7f..448f89b5 100644 Binary files a/SCHIZO/Resources/AssetBundles/assets and b/SCHIZO/Resources/AssetBundles/assets differ