Skip to content

Commit

Permalink
Merge pull request #11 from klyte45/master
Browse files Browse the repository at this point in the history
Adding support to ignore multiple implementations of NetTool
  • Loading branch information
Simie committed Oct 20, 2021
2 parents 380ffce + 58dfe55 commit 7d75828
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Src/PrecisionEngineering/Data/NetToolLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public static NetToolProxy Locate()
return null;
}

if (tools.Count > 1)
{
// May other mods use NetTool as base for creating new tools (like Upgrade Untouchable) - so try to get exact class, once it's used by the game as default net tool
Debug.Log($"Multiple NetTool instances found, trying to get exact type member.");
tools = tools.Where(p => p.GetType() == toolType).ToList();
}

if (tools.Count > 1)
{
// The "First" NetTool created is the one we want, since it's the one Unity seems to use.
Expand Down

0 comments on commit 7d75828

Please sign in to comment.