added missing phrase file and hopefully fixed errors thrown by mapchooser

This commit is contained in:
jenz 2023-03-23 19:47:48 +01:00
parent 709a07a62b
commit 5840846119
3 changed files with 158 additions and 72 deletions

View File

@ -1242,11 +1242,15 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
RemoveStringFromArray(g_NextMapList, map); RemoveStringFromArray(g_NextMapList, map);
/* Notify Nominations that this map is now free */ /* Notify Nominations that this map is now free */
//2023-03-23 edit to prevent index going out of range
if (GetArraySize(g_NominateOwners) > i)
{
Call_StartForward(g_NominationsResetForward); Call_StartForward(g_NominationsResetForward);
Call_PushString(map); Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i)); Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish(); Call_Finish();
} }
}
/* Clear out the rest of the nominations array */ /* Clear out the rest of the nominations array */
for(int i = nominationsToAdd; i < nominateCount; i++) for(int i = nominationsToAdd; i < nominateCount; i++)
@ -1256,11 +1260,15 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
/* These maps shouldn't be excluded from the vote as they weren't really nominated at all */ /* These maps shouldn't be excluded from the vote as they weren't really nominated at all */
/* Notify Nominations that this map is now free */ /* Notify Nominations that this map is now free */
//2023-03-23 edit to prevent index going out of range
if (GetArraySize(g_NominateOwners) > i)
{
Call_StartForward(g_NominationsResetForward); Call_StartForward(g_NominationsResetForward);
Call_PushString(map); Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i)); Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish(); Call_Finish();
} }
}
/* There should currently be 'nominationsToAdd' unique maps in the vote */ /* There should currently be 'nominationsToAdd' unique maps in the vote */
@ -2619,6 +2627,8 @@ void CheckMapRestrictions(bool time = false, bool players = false)
} }
if (remove) if (remove)
{
if (GetArraySize(g_NominateOwners) > i)
{ {
Call_StartForward(g_NominationsResetForward); Call_StartForward(g_NominationsResetForward);
Call_PushString(map); Call_PushString(map);
@ -2631,6 +2641,7 @@ void CheckMapRestrictions(bool time = false, bool players = false)
} }
} }
} }
}
} }
stock int InternalGetMapMinTime(const char[] map) stock int InternalGetMapMinTime(const char[] map)

View File

@ -931,6 +931,9 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
} }
} }
case MenuAction_Select: case MenuAction_Select:
{
//2023-03-22 edit since client sometimes is 0 which fucks up mapchooser
if (param1 > 0 && param1 <= MaxClients && IsClientConnected(param1) && IsClientInGame(param1))
{ {
if(g_Player_NominationDelay[param1] > GetTime()) if(g_Player_NominationDelay[param1] > GetTime())
{ {
@ -985,6 +988,7 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p
LogMessage("%s nominated %s", name, map); LogMessage("%s nominated %s", name, map);
g_Player_NominationDelay[param1] = GetTime() + GetConVarInt(g_Cvar_NominateDelay); g_Player_NominationDelay[param1] = GetTime() + GetConVarInt(g_Cvar_NominateDelay);
} }
}
case MenuAction_DrawItem: case MenuAction_DrawItem:
{ {

View File

@ -0,0 +1,71 @@
"Phrases"
{
"Already Nominated"
{
"en" "You have already nominated a map."
}
"Max Nominations"
{
"en" "The maximum allowed nominations has been reached."
}
"Map Already In Vote"
{
"#format" "{1:s}"
"en" "Map '{1}' already in the nominations list."
}
"Map Inserted"
{
"#format" "{1:s}"
"en" "Map '{1}' added to the nominations list."
}
"Map Already Nominated"
{
"en" "The map you chose has already been nominated."
}
"Map Nominated"
{
"#format" "{1:s},{2:s}"
"en" "{1} has nominated {2}."
}
"Map Nomination Changed"
{
"#format" "{1:s},{2:s}"
"en" "{1} has changed their nomination to {2}."
}
"Nominate Title"
{
"en" "Nominate Map:"
}
"Can't Nominate Current Map"
{
"en" "The map you chose is the current map and cannot be nominated"
}
"Map in Exclude List"
{
"en" "The map you chose was recently played and cannot be nominated"
}
"Current Map"
{
"en" "Current Map"
}
"Recently Played"
{
"en" "Recently Played"
}
"Nominated"
{
"en" "Nominated"
}
}