Improve logging on map/generic votes (#1362)

This commit is contained in:
Loïc
2021-03-08 05:02:20 -08:00
committed by GitHub
parent 6ea1e39ee4
commit 52c4d08e15
2 changed files with 26 additions and 11 deletions
+14 -5
View File
@@ -31,6 +31,8 @@
* Version: $Id$
*/
#define MAPS_COUNT 5
Menu g_MapList;
int g_mapCount;
@@ -39,7 +41,14 @@ bool g_VoteMapInUse;
void DisplayVoteMapMenu(int client, int mapCount, char[][] maps)
{
LogAction(client, -1, "\"%L\" initiated a map vote.", client);
char maps_list[MAPS_COUNT * (PLATFORM_MAX_PATH + 1)];
for (int i = 0; i < mapCount; i++)
{
Format(maps_list, sizeof(maps_list), "%s %s", maps_list, maps[i]);
}
LogAction(client, -1, "\"%L\" initiated a map vote for%s.", client, maps_list);
ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map");
g_voteType = map;
@@ -111,7 +120,7 @@ public int MenuHandler_Confirm(Menu menu, MenuAction action, int param1, int par
}
else if (action == MenuAction_Select)
{
char maps[5][PLATFORM_MAX_PATH];
char maps[MAPS_COUNT][PLATFORM_MAX_PATH];
int selectedmaps = g_SelectedMaps.Length;
for (int i = 0; i < selectedmaps; i++)
@@ -163,7 +172,7 @@ public int MenuHandler_Map(Menu menu, MenuAction action, int param1, int param2)
g_SelectedMaps.PushString(info);
/* Redisplay the list */
if (g_SelectedMaps.Length < 5)
if (g_SelectedMaps.Length < MAPS_COUNT)
{
g_MapList.Display(param1, MENU_TIME_FOREVER);
}
@@ -237,11 +246,11 @@ public Action Command_Votemap(int client, int args)
char text[256];
GetCmdArgString(text, sizeof(text));
char maps[5][PLATFORM_MAX_PATH];
char maps[MAPS_COUNT][PLATFORM_MAX_PATH];
int mapCount;
int len, pos;
while (pos != -1 && mapCount < 5)
while (pos != -1 && mapCount < MAPS_COUNT)
{
pos = BreakString(text[len], maps[mapCount], sizeof(maps[]));