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
@@ -1242,10 +1242,14 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
RemoveStringFromArray(g_NextMapList, map);
/* Notify Nominations that this map is now free */
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
//2023-03-23 edit to prevent index going out of range
if (GetArraySize(g_NominateOwners) > i)
{
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
}
}
/* Clear out the rest of the nominations array */
@@ -1256,10 +1260,14 @@ 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 */
/* Notify Nominations that this map is now free */
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
//2023-03-23 edit to prevent index going out of range
if (GetArraySize(g_NominateOwners) > i)
{
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
}
}
/* There should currently be 'nominationsToAdd' unique maps in the vote */
@@ -2620,14 +2628,17 @@ void CheckMapRestrictions(bool time = false, bool players = false)
if (remove)
{
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
if (GetArraySize(g_NominateOwners) > i)
{
Call_StartForward(g_NominationsResetForward);
Call_PushString(map);
Call_PushCell(GetArrayCell(g_NominateOwners, i));
Call_Finish();
RemoveFromArray(g_NominateList[client], i);
RemoveFromArray(g_NominateOwners, i);
g_NominateCount--;
RemoveFromArray(g_NominateList[client], i);
RemoveFromArray(g_NominateOwners, i);
g_NominateCount--;
}
}
}
}