preventing leader nomination from getting picked in wrong order
This commit is contained in:
parent
103cbc4d56
commit
8b94b0fc45
@ -1053,7 +1053,7 @@ public Action Command_Mapvote(int client, int args)
|
|||||||
return Plugin_Handled;
|
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);
|
int arraySize = ByteCountToCells(PLATFORM_MAX_PATH);
|
||||||
Handle most_nominated_maps = CreateArray(arraySize);
|
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);
|
sm.SetValue(map_iteration, nominate_count_for_particular_map, true);
|
||||||
|
|
||||||
/* Notify Nominations that this map is now free */
|
if (!create_next_vote)
|
||||||
Call_StartForward(g_NominationsResetForward);
|
{
|
||||||
Call_PushString(map_iteration);
|
/* Notify Nominations that this map is now free */
|
||||||
Call_PushCell(i + 100); //differentiate between all other calls and the call invoked by get_most_nominated_maps()
|
Call_StartForward(g_NominationsResetForward);
|
||||||
Call_Finish();
|
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];
|
static char map_[PLATFORM_MAX_PATH];
|
||||||
@ -1284,7 +1287,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
|
|||||||
{
|
{
|
||||||
Handle randomizeList = INVALID_HANDLE;
|
Handle randomizeList = INVALID_HANDLE;
|
||||||
//2023 edit to allow multiple nominations per player
|
//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
|
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));
|
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);
|
Handle panel = view_as<Handle>(param2);
|
||||||
SetPanelTitle(panel, buffer);
|
SetPanelTitle(panel, buffer);
|
||||||
char PannelText[256] = "Warning: The Position of the Maps are different for each Player.";
|
//char PannelText[256] = "Warning: The Position of the Maps are different for each Player.";
|
||||||
DrawPanelText(panel, PannelText);
|
//DrawPanelText(panel, PannelText);
|
||||||
}
|
}
|
||||||
|
|
||||||
case MenuAction_DisplayItem:
|
case MenuAction_DisplayItem:
|
||||||
@ -1991,7 +1994,7 @@ void CreateNextVote()
|
|||||||
int groups_[32];
|
int groups_[32];
|
||||||
|
|
||||||
//2023 edit
|
//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++)
|
for(int i = 0; i < GetArraySize(most_nominated_maps); i++)
|
||||||
{
|
{
|
||||||
GetArrayString(most_nominated_maps, i, map_, PLATFORM_MAX_PATH);
|
GetArrayString(most_nominated_maps, i, map_, PLATFORM_MAX_PATH);
|
||||||
|
Loading…
Reference in New Issue
Block a user