1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Merge pull request #160 from TES3MP/tes3mp-LoadedCell

[Server] Don't crash server every time a player disconnects
This commit is contained in:
David Cernat 2017-02-20 01:49:49 +02:00 committed by GitHub
commit 7321774ae2

View file

@ -169,7 +169,9 @@ void CellController::removePlayer(Cell *cell, Player *player)
void CellController::deletePlayer(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) for (auto it = cell->begin(); it != cell->end(); ++it)
{ {
if (*it == player) if (*it == player)