Merge pull request #160 from TES3MP/tes3mp-LoadedCell

[Server] Don't crash server every time a player disconnects
pull/163/head
David Cernat 8 years ago committed by GitHub
commit 7321774ae2

@ -169,7 +169,9 @@ void CellController::removePlayer(Cell *cell, Player *player)
void CellController::deletePlayer(Player *player)
{
for_each (player->getCells().begin(), player->getCells().end(), [&player](Cell *cell) {
std::deque<Cell *> playerCells = player->getCells();
for_each(playerCells.begin(), playerCells.end(), [&player](Cell *cell) {
for (auto it = cell->begin(); it != cell->end(); ++it)
{
if (*it == player)

Loading…
Cancel
Save