If a variable is set globally (i.e. to make it a const) with a function and fails to do so for whatever reason (maybe due to the order of Openplanet's startup sequence), an exception is thrown but the plugin will continue to run anyway, causing numerous other exceptions when that variable is called later on. This seems to happen with GetApp() when the game boots, but reloading the plugin makes it work fine, and there are probably other things that can cause this. Not all functions will do this, i.e. UI::GetScale() can be called globally with no issues arising.
If a variable fails to initialize for any reason, the plugin should be stopped. Also, if GetApp() is used globally, a warning should be shown telling the developer not to do that.
If a variable is set globally (i.e. to make it a
const
) with a function and fails to do so for whatever reason (maybe due to the order of Openplanet's startup sequence), an exception is thrown but the plugin will continue to run anyway, causing numerous other exceptions when that variable is called later on. This seems to happen withGetApp()
when the game boots, but reloading the plugin makes it work fine, and there are probably other things that can cause this. Not all functions will do this, i.e.UI::GetScale()
can be called globally with no issues arising.If a variable fails to initialize for any reason, the plugin should be stopped. Also, if
GetApp()
is used globally, a warning should be shown telling the developer not to do that.