Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero committed Nov 17, 2023
1 parent 8102fd8 commit 251d459
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
5 changes: 2 additions & 3 deletions SCHIZO/Creatures/Components/CarryCreature.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections;
using SCHIZO.Helpers;
using UnityEngine;

namespace SCHIZO.Creatures.Components;
Expand Down Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions SCHIZO/Creatures/Ermfish/ErmStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void StartStacking()
{
ErmStack target = FindTarget();
if (!target || target == this) return;

socket.SetTarget(target.plug);
}

Expand Down Expand Up @@ -94,8 +94,7 @@ ErmStack FindNearest_TechType()
.OfTechType(selfTechType)
.OrderByDistanceTo(gameObject.transform.position)
.SelectComponentInParent<ErmStack>()
.Where(s => !s.nextSocket && s != this)
.FirstOrDefault();
.FirstOrDefault(s => !s.nextSocket && s != this);
}
}

Expand Down Expand Up @@ -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();
}
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions SCHIZO/Items/ClonePrefab.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.CodeAnalysis;
using Nautilus.Assets.PrefabTemplates;
using UnityEngine;

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion SCHIZO/Resources/AssetBundles/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Binary file modified SCHIZO/Resources/AssetBundles/assets
Binary file not shown.

0 comments on commit 251d459

Please sign in to comment.