From 1bb45b3ca2c4169577d1a1c92e6eda060f459aae Mon Sep 17 00:00:00 2001 From: ArKaNeMaN Date: Thu, 5 Dec 2024 16:32:26 +0300 Subject: [PATCH] Create keys trie in `plugin_init` --- scripting/player_prefs.sma | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripting/player_prefs.sma b/scripting/player_prefs.sma index c01c4a4..9abc922 100644 --- a/scripting/player_prefs.sma +++ b/scripting/player_prefs.sma @@ -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(); @@ -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); }