Skip to content
Snippets Groups Projects
Commit 2b64c123 authored by aurora's avatar aurora
Browse files

Fixed bug in void readFromFile();

parent b687835e
No related branches found
No related tags found
No related merge requests found
......@@ -282,14 +282,15 @@ else
* Reads all data belonging to the Player class from the file
*/
void readFromFile(){
Player* playerNew;
ifstream infile("PlayerList.dta");
if(infile){
while(!infile.eof()){
newPlayer = new Player();
newPlayer ->readFromFilePlayer(infile);
gPlayers.push_back(newPlayer);
playerNew = new Player();
playerNew ->readFromFilePlayer(infile);
gPlayers.push_back(playerNew);
}
infile.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment