Skip to content

Commit

Permalink
Merge pull request #25 from ArKaNeMaN/fix/invalid-handle-in-set-pref
Browse files Browse the repository at this point in the history
Fix issue#17
  • Loading branch information
ufame authored Dec 5, 2024
2 parents b9dd042 + 1bb45b3 commit 6269f8f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripting/player_prefs.sma
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ new bool: g_bDebugMode;
public plugin_init() {
register_plugin("Player preferences", "1.2.0", "ufame");

if (g_tKeys == Invalid_Trie) {
g_tKeys = TrieCreate();
}

CreateForwards();
ReadDbCredentials();

Expand Down Expand Up @@ -166,9 +170,6 @@ public bool: native_set_key_default_value(iPlugin, iArgs) {
SQL_ThreadQuery(g_hSqlTuple, "ThreadQuery_Handler", g_szQuery, iData, sizeof iData);
}

if (g_tKeys == Invalid_Trie)
g_tKeys = TrieCreate();

return bool: TrieSetString(g_tKeys, szKey, szDefaultValue);
}

Expand Down

0 comments on commit 6269f8f

Please sign in to comment.