Fix crash in a warning message

openmw-38
scrawl 9 years ago
parent 723c392a73
commit d6bcb7906d

@ -810,19 +810,21 @@ namespace MWWorld
if (!visitor.mFound) 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; continue;
} }
MWWorld::LiveCellRefBase* movedRef = visitor.mFound;
CellStore* otherCell = callback->getCellStore(movedTo); CellStore* otherCell = callback->getCellStore(movedTo);
if (otherCell == NULL) 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; << " (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. // Note by dropping tag the object will automatically re-appear in its original cell, though potentially at inapproriate coordinates.
// Restore original coordinates: // Restore original coordinates:
visitor.mFound->mData.setPosition(visitor.mFound->mRef.getPosition()); movedRef->mData.setPosition(movedRef->mRef.getPosition());
continue; continue;
} }
@ -833,7 +835,7 @@ namespace MWWorld
continue; continue;
} }
moveTo(MWWorld::Ptr(visitor.mFound, this), otherCell); moveTo(MWWorld::Ptr(movedRef, this), otherCell);
} }
updateMergedRefs(); updateMergedRefs();

Loading…
Cancel
Save