From 499c7db12112ebd37e568f0490472cce1f64dc60 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 31 Aug 2017 14:48:23 +0300 Subject: [PATCH] [Server] Initialize interiors correctly if exterior 0, 0 has been loaded --- apps/openmw-mp/CellController.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/openmw-mp/CellController.cpp b/apps/openmw-mp/CellController.cpp index 48330c53e..6f1b96838 100644 --- a/apps/openmw-mp/CellController.cpp +++ b/apps/openmw-mp/CellController.cpp @@ -86,8 +86,15 @@ Cell *CellController::addCell(ESM::Cell cellData) auto it = find_if(cells.begin(), cells.end(), [cellData](const Cell *c) { // Currently we cannot compare because plugin lists can be loaded in different order //return c->cell.sRecordId == cellData.sRecordId; - return c->cell.isExterior() ? (c->cell.mData.mX == cellData.mData.mX && c->cell.mData.mY == cellData.mData.mY) : - (c->cell.mName == cellData.mName); + if (c->cell.isExterior() && cellData.isExterior()) + { + if (c->cell.mData.mX == cellData.mData.mX && c->cell.mData.mY == cellData.mData.mY) + return true; + } + else if (c->cell.mName == cellData.mName) + return true; + + return false; }); Cell *cell;