From d6bcb7906de20ca78869de3c96252ecefafb33b5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 Dec 2015 16:10:55 +0100 Subject: [PATCH] Fix crash in a warning message --- apps/openmw/mwworld/cellstore.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 164ce5533..f8d53bbd9 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -810,19 +810,21 @@ namespace MWWorld if (!visitor.mFound) { - std::cout << "Dropping moved ref tag for " << visitor.mFound->mRef.getRefId() << " (moved object no longer exists)" << std::endl; + std::cerr << "Dropping moved ref tag for " << refnum.mIndex << " (moved object no longer exists)" << std::endl; continue; } + MWWorld::LiveCellRefBase* movedRef = visitor.mFound; + CellStore* otherCell = callback->getCellStore(movedTo); if (otherCell == NULL) { - std::cerr << "Dropping moved ref tag for " << visitor.mFound->mRef.getRefId() + std::cerr << "Dropping moved ref tag for " << movedRef->mRef.getRefId() << " (target cell " << movedTo.mWorldspace << " no longer exists). Reference moved back to its original location." << std::endl; // Note by dropping tag the object will automatically re-appear in its original cell, though potentially at inapproriate coordinates. // Restore original coordinates: - visitor.mFound->mData.setPosition(visitor.mFound->mRef.getPosition()); + movedRef->mData.setPosition(movedRef->mRef.getPosition()); continue; } @@ -833,7 +835,7 @@ namespace MWWorld continue; } - moveTo(MWWorld::Ptr(visitor.mFound, this), otherCell); + moveTo(MWWorld::Ptr(movedRef, this), otherCell); } updateMergedRefs();