while(type!='q' && type!='Q'){
inFile>> name >> coordX >> coordY >> dir;
MakeSquad( type , name , coordX , coordY , dir , squad , MapOfSquads);
inFile >> type;
if(type == 'q' || type == 'Q')
squad++;
}
}
}
void MakeSquad(char type, string name, int coordX, int coordY, char dir, int squad)
{
MapOfSquads.insert(make_pair(name , Squad(squad)); // Squad( int ) just converts the int squad number to the Enum.
}
I get the segmentation fault whenever it tries to insert the first player.. however whenever i do this :
void MakeSquad(char type, string name, int coordX, int coordY, char dir, int squad)
{
GameSpace::MapSquadType MapOfSquads;
MapOfSquads.insert(make_pair(name , Squad(squad)); // Squad( int ) just converts the int squad number to the Enum.
}