[Server] Compare new cells with loaded cells correctly

pull/172/head
Koncord 8 years ago
parent c9dc75f589
commit 45d081ba42

@ -127,8 +127,8 @@ Cell *CellController::addCell(ESM::Cell cellData)
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Loaded cells: %d", cells.size()); LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Loaded cells: %d", cells.size());
auto it = find_if(cells.begin(), cells.end(), [cellData](const Cell *c) { auto it = find_if(cells.begin(), cells.end(), [cellData](const Cell *c) {
//return c->cell.sRecordId == cellData.sRecordId; // Currently we cannot compare because plugin lists can be loaded in different order //return c->cell.sRecordId == cellData.sRecordId; // Currently we cannot compare because plugin lists can be loaded in different order
return c->cell.mData.mX == cellData.mData.mX && c->cell.mData.mY == cellData.mData.mY && return c->cell.isExterior() ? (c->cell.mData.mX == cellData.mData.mX && c->cell.mData.mY == cellData.mData.mY) :
c->cell.mCellId.mWorldspace == cellData.mCellId.mWorldspace; (c->cell.mName == cellData.mName);
}); });
Cell *cell; Cell *cell;
if (it == cells.end()) if (it == cells.end())

Loading…
Cancel
Save