Skip to content

Commit a46da35

Browse files
committed
Unload correctly if gamedata file is missing
1 parent fd02093 commit a46da35

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

extension.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,14 +1538,14 @@ bool SendVarEdit::SDK_OnMetamodLoad(ISmmAPI* ismm, char* error, size_t maxlen, b
15381538

15391539
bool SendVarEdit::SDK_OnLoad(char* error, size_t maxlength, bool late)
15401540
{
1541-
sharesys->AddDependency(myself, "sdkhooks.ext", true, true);
1542-
15431541
// get info about what registers and stack offsets function variables are stored at
15441542
gameconfs->AddUserConfigHook("Variables", &g_variables);
15451543

15461544
IGameConfig* gameconf;
1547-
if (!gameconfs->LoadGameConfigFile("sendvaredit", &gameconf, error, maxlength))
1545+
if (!gameconfs->LoadGameConfigFile("sendvaredit", &gameconf, error, maxlength)) {
1546+
gameconfs->RemoveUserConfigHook("Variables", &g_variables);
15481547
return false;
1548+
}
15491549

15501550
// fill out game info struct
15511551
{
@@ -1677,6 +1677,8 @@ bool SendVarEdit::SDK_OnLoad(char* error, size_t maxlength, bool late)
16771677

16781678
gameconfs->CloseGameConfigFile(gameconf);
16791679

1680+
sharesys->AddDependency(myself, "sdkhooks.ext", true, true);
1681+
16801682
return true;
16811683
}
16821684

0 commit comments

Comments
 (0)