From 07acd7a721c367bb8538b529faf5c0b7331f92f1 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 9 Oct 2016 10:29:30 +0300 Subject: [PATCH] Make player markers work in interiors and make them easier to test --- apps/openmw/mwmp/GUIController.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index 0d93a2e37..2ee4c91c2 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -150,14 +150,17 @@ bool mwmp::GUIController::pressedKey(int key) printf("mwmp::GUIController::pressedKey.newFocus: %s.\n", newFocus ? newFocus->getName().c_str() : "nil");*/ return true; } - else if(key == SDLK_RETURN) + else if(key == SDLK_BACKSPACE) { + /* static bool test = true; if(test) { test = false; SetMapVisibility(0, true); } + */ + SetMapVisibility(0, true); } return false; } @@ -242,7 +245,18 @@ void mwmp::GUIController::SetMapVisibility(int pid, bool state) mEditingMarker.mWorldX = world->getPlayerPtr().getRefData().getPosition().pos[0]; mEditingMarker.mWorldY = world->getPlayerPtr().getRefData().getPosition().pos[1]; - mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace; + + mEditingMarker.mCell.mPaged = ptrCell->isExterior(); + + if (!ptrCell->isExterior()) + mEditingMarker.mCell.mWorldspace = ptrCell->mName; + else + { + mEditingMarker.mCell.mWorldspace = ESM::CellId::sDefaultWorldspace; + mEditingMarker.mCell.mIndex.mX = ptrCell->getGridX(); + mEditingMarker.mCell.mIndex.mY = ptrCell->getGridY(); + } + mPlayerMarkers.addMarker(mEditingMarker, true); }