A
A_StClaire_
hi,
my poker game does
playersActiveInRound = players;
at the start of every round where both are vector<Player> (i.e.,
containers of a user-defined class). the latter vector is everyone who
hasn't run out of money yet.
in a round, when someone folds I wish to remove them from
playersActiveInRound by calling
void Game:ropPlayer(Player& targetPlayer)
{
for(posPlayer = playersActiveInRound.begin(); posPlayer !=
playersActiveInRound.end(); ++posPlayer)
{
if((*posPlayer).GetFullName() == targetPlayer.GetFullName())
{
playersActiveInRound.erase(posPlayer);
}
}
}
and feeding it the Player identifier.
can anyone tell me why I get a crash everytime this function runs?
thx a lot
my poker game does
playersActiveInRound = players;
at the start of every round where both are vector<Player> (i.e.,
containers of a user-defined class). the latter vector is everyone who
hasn't run out of money yet.
in a round, when someone folds I wish to remove them from
playersActiveInRound by calling
void Game:ropPlayer(Player& targetPlayer)
{
for(posPlayer = playersActiveInRound.begin(); posPlayer !=
playersActiveInRound.end(); ++posPlayer)
{
if((*posPlayer).GetFullName() == targetPlayer.GetFullName())
{
playersActiveInRound.erase(posPlayer);
}
}
}
and feeding it the Player identifier.
can anyone tell me why I get a crash everytime this function runs?
thx a lot