diff --git a/apps/openmw/mwworld/cell.cpp b/apps/openmw/mwworld/cell.cpp index f4a57b87c9..9f1ad3e4a2 100644 --- a/apps/openmw/mwworld/cell.cpp +++ b/apps/openmw/mwworld/cell.cpp @@ -22,13 +22,15 @@ namespace MWWorld , mRegion(ESM::RefId()) // Unimplemented for now , mId(cell.mId) , mParent(cell.mParent) - ,mMood{ + , mWaterHeight(cell.mWaterHeight) + , mDescription(cell.mEditorId) + , mMood{ .mAmbiantColor = cell.mLighting.ambient, .mDirectionalColor = cell.mLighting.directional, .mFogColor = cell.mLighting.fogColor, // TODO: use ESM4::Lighting fog parameters - .mFogDensity = 1.f,} - ,mWaterHeight(cell.mWaterHeight) + .mFogDensity = 1.f, + } { if (isExterior()) { @@ -50,26 +52,19 @@ namespace MWWorld , mRegion(cell.mRegion) , mId(cell.mId) , mParent(ESM::Cell::sDefaultWorldspaceId) + , mWaterHeight(cell.mWater) + , mDescription(cell.getDescription()) , mMood{ .mAmbiantColor = cell.mAmbi.mAmbient, .mDirectionalColor = cell.mAmbi.mSunlight, .mFogColor = cell.mAmbi.mFog, .mFogDensity = cell.mAmbi.mFogDensity, } - ,mWaterHeight(cell.mWater) { if (isExterior()) mWaterHeight = -1.f; } - std::string Cell::getDescription() const - { - return ESM::visit(ESM::VisitOverload{ - [&](const ESM::Cell& cell) { return cell.getDescription(); }, - [&](const ESM4::Cell& cell) { return cell.mEditorId; }, - }, - *this); - } ESM::RefId Cell::getWorldSpace() const { if (isExterior()) diff --git a/apps/openmw/mwworld/cell.hpp b/apps/openmw/mwworld/cell.hpp index 827b360a4b..1fa088eac4 100644 --- a/apps/openmw/mwworld/cell.hpp +++ b/apps/openmw/mwworld/cell.hpp @@ -44,7 +44,7 @@ namespace MWWorld const ESM::RefId& getRegion() const { return mRegion; } std::string_view getNameId() const { return mNameID; } std::string_view getDisplayName() const { return mDisplayname; } - std::string getDescription() const; + std::string_view getDescription() const { return mDescription; } const MoodData& getMood() const { return mMood; } float getWaterHeight() const { return mWaterHeight; } const ESM::RefId& getId() const { return mId; } @@ -63,9 +63,9 @@ namespace MWWorld ESM::RefId mRegion; ESM::RefId mId; ESM::RefId mParent; - MoodData mMood; - float mWaterHeight; + std::string mDescription; + MoodData mMood; }; }