Skip to content

Commit

Permalink
Switched back to an Init method for DefinitionAPI
Browse files Browse the repository at this point in the history
It was somehow receiving the method in the same tick, breaking OnReady users that also reference the API
  • Loading branch information
ari-steas committed Apr 20, 2024
1 parent 56f3229 commit aaa31a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Data/Scripts/AssemblyScripts/Definitions/DefinitionApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ModularDefinitionApi
/// <param name="modContext"></param>
/// <param name="onLoad">Method to be triggered when the API is ready.</param>
/// <exception cref="Exception"></exception>
public ModularDefinitionApi(IMyModContext modContext, Action onLoad = null)
public void Init(IMyModContext modContext, Action onLoad = null)
{
if (_isRegistered)
throw new Exception($"{GetType().Name}.Load() should not be called multiple times!");
Expand Down Expand Up @@ -415,7 +415,7 @@ public void RemoveChatCommand(string command)
private bool _apiInit;
private const long ApiChannel = 8774;
private IReadOnlyDictionary<string, Delegate> _methodMap;
private readonly IMyModContext _modContext;
private IMyModContext _modContext;

/// <summary>
/// Assigns all API methods. Internal function, avoid editing.
Expand Down

0 comments on commit aaa31a1

Please sign in to comment.