Skip to content
Snippets Groups Projects
Commit 3154d087 authored by TheHresvelgian's avatar TheHresvelgian
Browse files

enabled elaving delete loop

parent f84afa12
Branches
No related tags found
No related merge requests found
...@@ -66,7 +66,9 @@ void deletePlayer() ...@@ -66,7 +66,9 @@ void deletePlayer()
switch (choice) switch (choice)
{ {
case 1: case 1:
//delte playerList[index]=playerList[playerList.size()-1];
playerList.pop_back();
toDelete=false;
break; break;
case 2: case 2:
toDelete=false; toDelete=false;
...@@ -75,7 +77,6 @@ void deletePlayer() ...@@ -75,7 +77,6 @@ void deletePlayer()
cout << endl << "Invalid input!"; cout << endl << "Invalid input!";
break; break;
} }
} while (toDelete); } while (toDelete);
choice = lesInt("\nDo you wish to delete another player?\n1: yes\n2: no",1,2); choice = lesInt("\nDo you wish to delete another player?\n1: yes\n2: no",1,2);
switch (choice) switch (choice)
......
...@@ -8,10 +8,6 @@ extern vector<Player*> sortedRankings; ...@@ -8,10 +8,6 @@ extern vector<Player*> sortedRankings;
int searchByID(int id, int list) int searchByID(int id, int list)
{ {
if (playerList.size()==0)
{
return -2;
}
vector<Player*> listToUse; vector<Player*> listToUse;
if (list == 1) if (list == 1)
{ {
......
...@@ -8,10 +8,6 @@ extern vector<Player*> playerList; ...@@ -8,10 +8,6 @@ extern vector<Player*> playerList;
int searchByName(string name) int searchByName(string name)
{ {
if (playerList.size()==0)
{
return -2;
}
vector<Player*> searchlist; vector<Player*> searchlist;
string playerName; string playerName;
int findSize = 0; int findSize = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment