I'm trying to have a custom CVAR reset to default whenever you open GZDoom. I want to make sure players don't accidentally leave it active when unwanted because it's an optional setting that can make gameplay extremely unfun.
I tried:
Code: Select all
Class ResetAnnoyer : StaticEventHandler
{
override void OnEngineInitialize()
{
Cvar.ResetToDefault("my_cvar");
}
}
But it won't let me do that because resetting the CVAR is a non-static command and OnEngineInitialize is a Static Event Handler.
I get this error message:
Code: Select all
Cannot call non-static function CVar::ResetToDefault from here
Is there a way around this?
Thanks