From 138957c49aaa892e199c58371c7b3961b252945c Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 6 Dec 2015 18:43:52 +0100 Subject: [PATCH] Special case objects with no refnum --- apps/openmw/mwworld/cellstore.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 507e3fd7f..edeb4f08d 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -213,6 +213,15 @@ namespace MWWorld // TODO: ensure that the object actually exists in the cell + // Objects with no refnum can't be handled correctly in the merging process that happens + // on a save/load, so do a simple copy & delete for these objects. + if (!object.getCellRef().getRefNum().hasContentFile()) + { + MWWorld::Ptr copied = object.getClass().copyToCell(object, *cellToMoveTo); + object.getRefData().setCount(0); + return copied; + } + MovedRefTracker::iterator found = mMovedHere.find(object.getBase()); if (found != mMovedHere.end()) {