From d84d453eb1c68df81952a3f23d7e0bbd3dd8a50f Mon Sep 17 00:00:00 2001 From: Mistrick Date: Thu, 21 Apr 2022 21:43:26 +0700 Subject: [PATCH] sounds: check ini parser result --- .../amxmodx/scripting/map_manager_sounds.sma | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cstrike/addons/amxmodx/scripting/map_manager_sounds.sma b/cstrike/addons/amxmodx/scripting/map_manager_sounds.sma index bc92017..4c4f1e5 100644 --- a/cstrike/addons/amxmodx/scripting/map_manager_sounds.sma +++ b/cstrike/addons/amxmodx/scripting/map_manager_sounds.sma @@ -2,7 +2,7 @@ #include #define PLUGIN "Map Manager: Sounds" -#define VERSION "0.0.1" +#define VERSION "0.0.2" #define AUTHOR "Mistrick" #pragma semicolon 1 @@ -22,12 +22,10 @@ new g_sVoteStarted[128]; new g_sVoteFinished[128]; new Trie:g_tCountdownSounds; -public plugin_init() -{ - register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR); -} public plugin_precache() { + register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR); + g_tCountdownSounds = TrieCreate(); load_settings(); } @@ -37,7 +35,11 @@ load_settings() INI_SetParseEnd(parser, "ini_parse_end"); INI_SetReaders(parser, "ini_key_value", "ini_new_section"); - INI_ParseFile(parser, "addons/amxmodx/configs/map_manager_settings.ini"); + new bool:result = INI_ParseFile(parser, "addons/amxmodx/configs/map_manager_settings.ini"); + + if(!result) { + set_fail_state("Can't read from ini file."); + } } public ini_new_section(INIParser:handle, const section[], bool:invalid_tokens, bool:close_bracket, bool:extra_tokens, curtok, any:data) {