Why is #3 an invalid state? Everything works normally, the plugin is capable of running further. It could be for example "cannot connect to database" error; the connection could succeed the next time.
Wouldn't it just be easier to change the plugin calling interface to a single function:
Wouldn't it just be easier to change the plugin calling interface to a single function:
local Ret1, Ret2, Ret3 = cPluginManager:CallPlugin("PluginName", "FunctionName", FunctionArgs);There's no more cPlugin required, it can even be completely removed from the API. The plugin manager will either have the plugin and call the function, or will not have the plugin and ignore the call altogether. To distinguish the two, you can set up a protocol with the plugin that would require the protocol to always return at least 1 value; if you receive 0 values, then you know the call has failed.