Skip to content

Commit

Permalink
Merge pull request #45 from FeralCompany/master
Browse files Browse the repository at this point in the history
Allow optionally-defined BepInPlugin to support library usage (again)
  • Loading branch information
Rune580 authored Apr 15, 2024
2 parents 2f74ee2 + e38016c commit 603b7c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions LethalCompanyInputUtils/Api/LcInputActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ public abstract class LcInputActions

protected virtual string MapName => GetType().Name;

protected LcInputActions()
protected LcInputActions() : this(Assembly.GetCallingAssembly().GetBepInPlugin()) {}

protected LcInputActions(BepInPlugin? plugin)
{
Asset = ScriptableObject.CreateInstance<InputActionAsset>();
Plugin = Assembly.GetCallingAssembly().GetBepInPlugin() ?? throw new InvalidOperationException();
Plugin = plugin ?? throw new InvalidOperationException();

var mapBuilder = new InputActionMapBuilder(Id);

Expand Down

0 comments on commit 603b7c7

Please sign in to comment.