preventing leader nomination from getting picked in wrong order

This commit is contained in:
jenz 2024-07-23 21:24:05 +02:00
parent 103cbc4d56
commit 8b94b0fc45

View File

@ -1053,7 +1053,7 @@ public Action Command_Mapvote(int client, int args)
return Plugin_Handled;
}
public Handle get_most_nominated_maps()
public Handle get_most_nominated_maps(bool create_next_vote)
{
int arraySize = ByteCountToCells(PLATFORM_MAX_PATH);
Handle most_nominated_maps = CreateArray(arraySize);
@ -1094,11 +1094,14 @@ public Handle get_most_nominated_maps()
}
sm.SetValue(map_iteration, nominate_count_for_particular_map, true);
/* Notify Nominations that this map is now free */
Call_StartForward(g_NominationsResetForward);
Call_PushString(map_iteration);
Call_PushCell(i + 100); //differentiate between all other calls and the call invoked by get_most_nominated_maps()
Call_Finish();
if (!create_next_vote)
{
/* Notify Nominations that this map is now free */
Call_StartForward(g_NominationsResetForward);
Call_PushString(map_iteration);
Call_PushCell(i + 100); //differentiate between all other calls and the call invoked by get_most_nominated_maps()
Call_Finish();
}
}
}
static char map_[PLATFORM_MAX_PATH];
@ -1284,7 +1287,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
{
Handle randomizeList = INVALID_HANDLE;
//2023 edit to allow multiple nominations per player
Handle most_nominated_maps = get_most_nominated_maps();
Handle most_nominated_maps = get_most_nominated_maps(false);
int voteSize = GetVoteSize(0); //voteSize wrong size probably for my for loop
@ -1810,8 +1813,8 @@ public int Handler_MapVoteMenu(Handle menu, MenuAction action, int param1, int p
Format(buffer, sizeof(buffer), "%T", "Vote Nextmap", param1, player_mapvote_worth[param1], RoundToFloor((player_mapvote_worth[param1]/total_votes) * 100));
Handle panel = view_as<Handle>(param2);
SetPanelTitle(panel, buffer);
char PannelText[256] = "Warning: The Position of the Maps are different for each Player.";
DrawPanelText(panel, PannelText);
//char PannelText[256] = "Warning: The Position of the Maps are different for each Player.";
//DrawPanelText(panel, PannelText);
}
case MenuAction_DisplayItem:
@ -1991,7 +1994,7 @@ void CreateNextVote()
int groups_[32];
//2023 edit
Handle most_nominated_maps = get_most_nominated_maps();
Handle most_nominated_maps = get_most_nominated_maps(true);
for(int i = 0; i < GetArraySize(most_nominated_maps); i++)
{
GetArrayString(most_nominated_maps, i, map_, PLATFORM_MAX_PATH);