Skip to content

Commit c49c6e8

Browse files
committed
effects: cache current map name
1 parent 21efe80 commit c49c6e8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

addons/amxmodx/scripting/map_manager_effects.sma

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <map_manager>
55

66
#define PLUGIN "Map Manager: Effects"
7-
#define VERSION "0.0.5"
7+
#define VERSION "0.0.6"
88
#define AUTHOR "Mistrick"
99

1010
#pragma semicolon 1
@@ -48,6 +48,8 @@ new const g_sSound[][] = {
4848
"sound/fvox/six.wav", "sound/fvox/seven.wav", "sound/fvox/eight.wav", "sound/fvox/nine.wav", "sound/fvox/ten.wav"
4949
};
5050

51+
new g_sCurMap[MAPNAME_LENGTH];
52+
5153
public plugin_init()
5254
{
5355
register_plugin(PLUGIN, VERSION, AUTHOR);
@@ -63,6 +65,8 @@ public plugin_init()
6365
}
6466
public plugin_cfg()
6567
{
68+
get_mapname(g_sCurMap, charsmax(g_sCurMap));
69+
6670
if(get_num(BLOCK_CHAT)) {
6771
register_clcmd("say", "clcmd_say");
6872
register_clcmd("say_team", "clcmd_say");
@@ -182,11 +186,7 @@ stock freeze_unfreeze(type)
182186
}
183187
is_map_extended(const map[])
184188
{
185-
static curmap[MAPNAME_LENGTH];
186-
if(!curmap[0]) {
187-
get_mapname(curmap, charsmax(curmap));
188-
}
189-
return equali(map, curmap);
189+
return equali(map, g_sCurMap);
190190
}
191191
stock set_black_screenfade(fade)
192192
{

0 commit comments

Comments
 (0)