forked from teamnwah/openmw-tes3coop
[Server] Don't crash server every time a player disconnects
This commit is contained in:
parent
3e031faa96
commit
b829f0252a
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue