Skip to content

Commit d84d453

Browse files
committed
sounds: check ini parser result
1 parent 64101cc commit d84d453

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cstrike/addons/amxmodx/scripting/map_manager_sounds.sma

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <map_manager>
33

44
#define PLUGIN "Map Manager: Sounds"
5-
#define VERSION "0.0.1"
5+
#define VERSION "0.0.2"
66
#define AUTHOR "Mistrick"
77

88
#pragma semicolon 1
@@ -22,12 +22,10 @@ new g_sVoteStarted[128];
2222
new g_sVoteFinished[128];
2323
new Trie:g_tCountdownSounds;
2424

25-
public plugin_init()
26-
{
27-
register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR);
28-
}
2925
public plugin_precache()
3026
{
27+
register_plugin(PLUGIN, VERSION + VERSION_HASH, AUTHOR);
28+
3129
g_tCountdownSounds = TrieCreate();
3230
load_settings();
3331
}
@@ -37,7 +35,11 @@ load_settings()
3735

3836
INI_SetParseEnd(parser, "ini_parse_end");
3937
INI_SetReaders(parser, "ini_key_value", "ini_new_section");
40-
INI_ParseFile(parser, "addons/amxmodx/configs/map_manager_settings.ini");
38+
new bool:result = INI_ParseFile(parser, "addons/amxmodx/configs/map_manager_settings.ini");
39+
40+
if(!result) {
41+
set_fail_state("Can't read from ini file.");
42+
}
4143
}
4244
public ini_new_section(INIParser:handle, const section[], bool:invalid_tokens, bool:close_bracket, bool:extra_tokens, curtok, any:data)
4345
{

0 commit comments

Comments
 (0)