Fix buffer sizes used for map names (64 -> MAX_PATH).
As more games are now supporting maps nested in subfolders or in folders outside of the maps folder, we need to account for the full path that the game uses to refer to the map for compatibility. Many other places for fixed for this already after CS:GO added Steam Workshop support for maps.
This commit is contained in:
parent
974e18292a
commit
5139eef183
@ -109,7 +109,7 @@ public MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else if (action == MenuAction_Select)
|
||||
{
|
||||
decl String:maps[5][64];
|
||||
decl String:maps[5][PLATFORM_MAX_PATH];
|
||||
new selectedmaps = GetArraySize(g_SelectedMaps);
|
||||
|
||||
for (new i = 0; i < selectedmaps; i++)
|
||||
@ -233,7 +233,7 @@ public Action:Command_Votemap(client, args)
|
||||
decl String:text[256];
|
||||
GetCmdArgString(text, sizeof(text));
|
||||
|
||||
decl String:maps[5][64];
|
||||
decl String:maps[5][PLATFORM_MAX_PATH];
|
||||
new mapCount;
|
||||
new len, pos;
|
||||
|
||||
@ -283,7 +283,7 @@ int LoadMapList(Menu menu)
|
||||
|
||||
RemoveAllMenuItems(menu);
|
||||
|
||||
char map_name[64];
|
||||
char map_name[PLATFORM_MAX_PATH];
|
||||
new map_count = GetArraySize(g_map_array);
|
||||
|
||||
for (new i = 0; i < map_count; i++)
|
||||
|
@ -86,8 +86,8 @@ public void OnPluginStart()
|
||||
RegConsoleCmd("listmaps", Command_List);
|
||||
|
||||
// Set to the current map so OnMapStart() will know what to do
|
||||
char currentMap[64];
|
||||
GetCurrentMap(currentMap, 64);
|
||||
char currentMap[PLATFORM_MAX_PATH];
|
||||
GetCurrentMap(currentMap, sizeof(currentMap));
|
||||
SetNextMap(currentMap);
|
||||
}
|
||||
|
||||
@ -98,9 +98,9 @@ public void OnMapStart()
|
||||
|
||||
public void OnConfigsExecuted()
|
||||
{
|
||||
char lastMap[64], currentMap[64];
|
||||
char lastMap[PLATFORM_MAX_PATH], currentMap[PLATFORM_MAX_PATH];
|
||||
GetNextMap(lastMap, sizeof(lastMap));
|
||||
GetCurrentMap(currentMap, 64);
|
||||
GetCurrentMap(currentMap, sizeof(currentMap));
|
||||
|
||||
// Why am I doing this? If we switched to a new map, but it wasn't what we expected (Due to sm_map, sm_votemap, or
|
||||
// some other plugin/command), we don't want to scramble the map cycle. Or for example, admin switches to a custom map
|
||||
@ -146,8 +146,8 @@ void FindAndSetNextMap()
|
||||
|
||||
if (g_MapPos == -1)
|
||||
{
|
||||
char current[64];
|
||||
GetCurrentMap(current, 64);
|
||||
char current[PLATFORM_MAX_PATH];
|
||||
GetCurrentMap(current, sizeof(current));
|
||||
|
||||
for (int i = 0; i < mapCount; i++)
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ public Action Command_Addmap(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
char mapname[64];
|
||||
char mapname[PLATFORM_MAX_PATH];
|
||||
GetCmdArg(1, mapname, sizeof(mapname));
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ public Action Command_Nominate(int client, int args)
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
char mapname[64];
|
||||
char mapname[PLATFORM_MAX_PATH];
|
||||
GetCmdArg(1, mapname, sizeof(mapname));
|
||||
|
||||
int status;
|
||||
@ -257,10 +257,10 @@ void BuildMapMenu()
|
||||
|
||||
g_MapMenu = new Menu(Handler_MapSelectMenu, MENU_ACTIONS_DEFAULT|MenuAction_DrawItem|MenuAction_DisplayItem);
|
||||
|
||||
char map[64];
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
|
||||
ArrayList excludeMaps;
|
||||
char currentMap[32];
|
||||
char currentMap[PLATFORM_MAX_PATH];
|
||||
|
||||
if (g_Cvar_ExcludeOld.BoolValue)
|
||||
{
|
||||
@ -312,7 +312,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
{
|
||||
case MenuAction_Select:
|
||||
{
|
||||
char map[64], name[64];
|
||||
char map[PLATFORM_MAX_PATH], name[64];
|
||||
menu.GetItem(param2, map, sizeof(map));
|
||||
|
||||
GetClientName(param1, name, 64);
|
||||
@ -344,7 +344,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
|
||||
case MenuAction_DrawItem:
|
||||
{
|
||||
char map[64];
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
menu.GetItem(param2, map, sizeof(map));
|
||||
|
||||
int status;
|
||||
@ -366,7 +366,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
|
||||
|
||||
case MenuAction_DisplayItem:
|
||||
{
|
||||
char map[64];
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
menu.GetItem(param2, map, sizeof(map));
|
||||
|
||||
int status;
|
||||
|
Loading…
Reference in New Issue
Block a user