From ff0d21ef383243cc02202d46c4a6bc55c6fc4b7f Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 24 Feb 2017 19:42:33 +0200 Subject: [PATCH] [Client] Spawn in 0,0 if Pelagiad doesn't exist (for other master files) --- apps/openmw/mwworld/worldimp.cpp | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index d42a378ea..f7ca2c893 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -267,21 +267,26 @@ namespace MWWorld { ESM::Position pos; - /* Disabled by tes3mp - - const int cellSize = 8192; - pos.pos[0] = cellSize/2; - pos.pos[1] = cellSize/2; - pos.pos[2] = 0; - pos.rot[0] = 0; - pos.rot[1] = 0; - pos.rot[2] = 0; - mWorldScene->changeToExteriorCell(pos, true); - */ - - findExteriorPosition("Pelagiad", pos); - changeToExteriorCell(pos, true); - fixPosition(getPlayerPtr()); + // Major change made by tes3mp + // + // If Pelagiad exists, spawn there; otherwise, spawn at 0,0 + + if (findExteriorPosition("Pelagiad", pos)) + { + changeToExteriorCell(pos, true); + fixPosition(getPlayerPtr()); + } + else + { + const int cellSize = 8192; + pos.pos[0] = cellSize / 2; + pos.pos[1] = cellSize / 2; + pos.pos[2] = 0; + pos.rot[0] = 0; + pos.rot[1] = 0; + pos.rot[2] = 0; + mWorldScene->changeToExteriorCell(pos, true); + } } }