From 60affb5288f7d2abb53be16bf33a9b846bb2f96d Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 10 May 2012 12:47:15 +0200 Subject: [PATCH 01/17] removed include 2 --- apps/openmw/mwgui/formatting.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/openmw/mwgui/formatting.hpp b/apps/openmw/mwgui/formatting.hpp index c8f2c9e44..a1e115491 100644 --- a/apps/openmw/mwgui/formatting.hpp +++ b/apps/openmw/mwgui/formatting.hpp @@ -3,8 +3,6 @@ #include -#include - namespace MWGui { struct TextStyle From 65ccfba191318fd7b3bd4307ae62e08c9c6a26ac Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 11 May 2012 08:15:22 +0200 Subject: [PATCH 02/17] resize both the left and the right pane of the stats window --- apps/openmw/mwgui/stats_window.cpp | 4 + apps/openmw/mwgui/stats_window.hpp | 3 + files/mygui/openmw_stats_window_layout.xml | 109 +++++++++++---------- 3 files changed, 66 insertions(+), 50 deletions(-) diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 8b688984f..9e6e17391 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -60,6 +60,8 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager) getWidget(skillAreaWidget, "Skills"); getWidget(skillClientWidget, "SkillClient"); getWidget(skillScrollerWidget, "SkillScroller"); + getWidget(mLeftPane, "LeftPane"); + getWidget(mRightPane, "RightPane"); skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition); updateScroller(); @@ -93,6 +95,8 @@ void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos) void StatsWindow::onWindowResize(MyGUI::Window* window) { + mLeftPane->setCoord( MyGUI::IntCoord(0, 0, 0.44*window->getSize().width, window->getSize().height) ); + mRightPane->setCoord( MyGUI::IntCoord(0.44*window->getSize().width, 0, 0.56*window->getSize().width, window->getSize().height) ); updateScroller(); } diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp index ecbc82894..b201b3387 100644 --- a/apps/openmw/mwgui/stats_window.hpp +++ b/apps/openmw/mwgui/stats_window.hpp @@ -57,6 +57,9 @@ namespace MWGui static const int lineHeight; + MyGUI::Widget* mLeftPane; + MyGUI::Widget* mRightPane; + MyGUI::WidgetPtr skillAreaWidget, skillClientWidget; MyGUI::ScrollBar* skillScrollerWidget; int lastPos, clientHeight; diff --git a/files/mygui/openmw_stats_window_layout.xml b/files/mygui/openmw_stats_window_layout.xml index 4f3f80e89..4056216ad 100644 --- a/files/mygui/openmw_stats_window_layout.xml +++ b/files/mygui/openmw_stats_window_layout.xml @@ -3,59 +3,68 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1f1edea6af072a49889c5fac07fe2ab01aece314 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 11 May 2012 08:45:03 +0200 Subject: [PATCH 03/17] make it possible to use scroll wheel when mouse is over a skill in the stats window; set the correct track size for the scrollbar --- apps/openmw/mwgui/stats_window.cpp | 23 +++++++++++++++++++++- apps/openmw/mwgui/stats_window.hpp | 1 + files/mygui/openmw_stats_window_layout.xml | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 9e6e17391..2736270e1 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -63,6 +63,8 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager) getWidget(mLeftPane, "LeftPane"); getWidget(mRightPane, "RightPane"); + skillClientWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); + skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition); updateScroller(); @@ -93,6 +95,18 @@ void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos) } } +void StatsWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel) +{ + if (skillScrollerWidget->getScrollPosition() - _rel*0.3 < 0) + skillScrollerWidget->setScrollPosition(0); + else if (skillScrollerWidget->getScrollPosition() - _rel*0.3 > skillScrollerWidget->getScrollRange()-1) + skillScrollerWidget->setScrollPosition(skillScrollerWidget->getScrollRange()-1); + else + skillScrollerWidget->setScrollPosition(skillScrollerWidget->getScrollPosition() - _rel*0.3); + + onScrollChangePosition(skillScrollerWidget, skillScrollerWidget->getScrollPosition()); +} + void StatsWindow::onWindowResize(MyGUI::Window* window) { mLeftPane->setCoord( MyGUI::IntCoord(0, 0, 0.44*window->getSize().width, window->getSize().height) ); @@ -237,6 +251,7 @@ void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2) MyGUI::ImageBox* separator = skillClientWidget->createWidget("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch); + separator->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillWidgets.push_back(separator); coord1.top += separator->getHeight(); @@ -249,6 +264,7 @@ void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, My MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch); groupWidget->setCaption(label); + groupWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillWidgets.push_back(groupWidget); coord1.top += lineHeight; @@ -263,12 +279,14 @@ MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::st skillNameWidget->setCaption(text); skillNameWidget->setUserString("ToolTipType", "Text"); skillNameWidget->setUserString("ToolTipText", tooltip); + skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top); skillValueWidget->setUserString("ToolTipType", "Text"); skillValueWidget->setUserString("ToolTipText", tooltip); skillValueWidget->setCaption(value); skillValueWidget->_setWidgetState(state); + skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillWidgets.push_back(skillNameWidget); skillWidgets.push_back(skillValueWidget); @@ -285,6 +303,7 @@ void StatsWindow::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI skillNameWidget = skillClientWidget->createWidget("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default); skillNameWidget->setCaption(text); + skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel); skillWidgets.push_back(skillNameWidget); @@ -370,7 +389,7 @@ void StatsWindow::updateSkillArea() if (!skillWidgets.empty()) addSeparator(coord1, coord2); - addGroup(mWindowManager.getGameSettingString("sSign", "Sign"), coord1, coord2); + addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2); const ESM::BirthSign *sign = store.birthSigns.find(birthSignId); addItem(sign->name, coord1, coord2); } @@ -394,6 +413,8 @@ void StatsWindow::updateScroller() { skillScrollerWidget->setScrollRange(std::max(clientHeight - skillClientWidget->getHeight(), 0)); skillScrollerWidget->setScrollPage(std::max(skillClientWidget->getHeight() - lineHeight, 0)); + if (clientHeight != 0) + skillScrollerWidget->setTrackSize( (skillAreaWidget->getHeight() / float(clientHeight)) * skillAreaWidget->getHeight() ); } void StatsWindow::onPinToggled() diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp index b201b3387..08c5148ec 100644 --- a/apps/openmw/mwgui/stats_window.hpp +++ b/apps/openmw/mwgui/stats_window.hpp @@ -54,6 +54,7 @@ namespace MWGui void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos); void onWindowResize(MyGUI::Window* window); + void onMouseWheel(MyGUI::Widget* _sender, int _rel); static const int lineHeight; diff --git a/files/mygui/openmw_stats_window_layout.xml b/files/mygui/openmw_stats_window_layout.xml index 4056216ad..9406fe6bd 100644 --- a/files/mygui/openmw_stats_window_layout.xml +++ b/files/mygui/openmw_stats_window_layout.xml @@ -60,7 +60,7 @@ - + From 83e434e2e91c8a21becb88fac8687271cf42d8c2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 11 May 2012 09:35:18 +0200 Subject: [PATCH 04/17] small fix --- apps/openmw/mwgui/stats_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 2736270e1..186668222 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -414,7 +414,7 @@ void StatsWindow::updateScroller() skillScrollerWidget->setScrollRange(std::max(clientHeight - skillClientWidget->getHeight(), 0)); skillScrollerWidget->setScrollPage(std::max(skillClientWidget->getHeight() - lineHeight, 0)); if (clientHeight != 0) - skillScrollerWidget->setTrackSize( (skillAreaWidget->getHeight() / float(clientHeight)) * skillAreaWidget->getHeight() ); + skillScrollerWidget->setTrackSize( (skillAreaWidget->getHeight() / float(clientHeight)) * skillScrollerWidget->getLineSize() ); } void StatsWindow::onPinToggled() From a99f74702ed26f9c3bacfca5ed9688816c618132 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 11 May 2012 09:57:43 +0200 Subject: [PATCH 05/17] workaround for a white square that appears in menubook_next texture --- files/mygui/openmw_book_layout.xml | 2 +- files/mygui/openmw_journal_layout.xml | 2 +- files/mygui/openmw_resources.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/mygui/openmw_book_layout.xml b/files/mygui/openmw_book_layout.xml index 07ebf5030..6c708cdd3 100644 --- a/files/mygui/openmw_book_layout.xml +++ b/files/mygui/openmw_book_layout.xml @@ -7,7 +7,7 @@ - + diff --git a/files/mygui/openmw_journal_layout.xml b/files/mygui/openmw_journal_layout.xml index 75bb5eea1..e4c3c7e47 100644 --- a/files/mygui/openmw_journal_layout.xml +++ b/files/mygui/openmw_journal_layout.xml @@ -7,7 +7,7 @@ - + diff --git a/files/mygui/openmw_resources.xml b/files/mygui/openmw_resources.xml index 455765aad..b2bd90d10 100644 --- a/files/mygui/openmw_resources.xml +++ b/files/mygui/openmw_resources.xml @@ -72,7 +72,7 @@ - + From 82b9f835b1a907f72acec44a325cb1d5a74bf85e Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 13 May 2012 16:54:18 +0200 Subject: [PATCH 06/17] make sure iterator is not end() before trying to get the equipped item --- apps/openmw/mwworld/containerstore.cpp | 2 +- apps/openmw/mwworld/containerstore.hpp | 2 +- apps/openmw/mwworld/inventorystore.cpp | 4 ++-- apps/openmw/mwworld/inventorystore.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index dcddc333b..ee1b620cd 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -45,7 +45,7 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::end() return ContainerStoreIterator (this); } -bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const +bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2) { /// \todo add current weapon/armor health, remaining lockpick/repair uses, current enchantment charge here as soon as they are implemented if ( ptr1.mCellRef->refID == ptr2.mCellRef->refID diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp index f0e9d7e4a..3cb3f3bdc 100644 --- a/apps/openmw/mwworld/containerstore.hpp +++ b/apps/openmw/mwworld/containerstore.hpp @@ -78,7 +78,7 @@ namespace MWWorld void addImpl (const Ptr& ptr); ///< Add the item to this container (no stacking) - virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const; + virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2); ///< @return true if the two specified objects can stack with each other /// @note ptr1 is the item that is already in this container diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 6cf35ac64..3e535793c 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -201,7 +201,7 @@ void MWWorld::InventoryStore::autoEquip (const MWMechanics::NpcStats& stats) } } -bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const +bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) { bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2); if (!canStack) @@ -211,7 +211,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2) const for (TSlots::const_iterator iter (mSlots.begin()); iter!=mSlots.end(); ++iter) { - if (ptr1 == **iter) + if (*iter != end() && ptr1 == **iter) return false; } diff --git a/apps/openmw/mwworld/inventorystore.hpp b/apps/openmw/mwworld/inventorystore.hpp index 4162c7e2e..05fc651ee 100644 --- a/apps/openmw/mwworld/inventorystore.hpp +++ b/apps/openmw/mwworld/inventorystore.hpp @@ -67,7 +67,7 @@ namespace MWWorld protected: - virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2) const; + virtual bool stacks (const Ptr& ptr1, const Ptr& ptr2); ///< @return true if the two specified objects can stack with each other /// @note ptr1 is the item that is already in this container From c6493fb133b36bec6aeccb634d1cfb4b3bd1335f Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 15 May 2012 21:17:00 +0200 Subject: [PATCH 07/17] added getCapacity function --- apps/openmw/mwclass/container.cpp | 8 ++++++++ apps/openmw/mwclass/container.hpp | 4 ++++ apps/openmw/mwclass/creature.cpp | 6 ++++++ apps/openmw/mwclass/creature.hpp | 4 ++++ apps/openmw/mwclass/npc.cpp | 6 ++++++ apps/openmw/mwclass/npc.hpp | 4 ++++ apps/openmw/mwworld/class.cpp | 5 +++++ apps/openmw/mwworld/class.hpp | 5 +++++ 8 files changed, 42 insertions(+) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index a9def96aa..82a9212a2 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -176,4 +176,12 @@ namespace MWClass return info; } + + float Container::getCapactiy (const MWWorld::Ptr& ptr) const + { + ESMS::LiveCellRef *ref = + ptr.get(); + + return ref->base->weight; + } } diff --git a/apps/openmw/mwclass/container.hpp b/apps/openmw/mwclass/container.hpp index 3b1c8de09..0231ce26b 100644 --- a/apps/openmw/mwclass/container.hpp +++ b/apps/openmw/mwclass/container.hpp @@ -36,6 +36,10 @@ namespace MWClass virtual std::string getScript (const MWWorld::Ptr& ptr) const; ///< Return name of the script attached to ptr + virtual float getCapactiy (const MWWorld::Ptr& ptr) const; + ///< Return total weight that fits into the object (including modifications from magic + /// effects). Throws an exception, if the object can't hold other objects. + static void registerSelf(); }; } diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index cf00f361b..a16455430 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -166,4 +166,10 @@ namespace MWClass return info; } + + float Creature::getCapactiy (const MWWorld::Ptr& ptr) const + { + const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); + return stats.mAttributes[0].getModified()*5; + } } diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index 4a1a8285f..c68d1995d 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -52,6 +52,10 @@ namespace MWClass virtual std::string getScript (const MWWorld::Ptr& ptr) const; ///< Return name of the script attached to ptr + virtual float getCapactiy (const MWWorld::Ptr& ptr) const; + ///< Return total weight that fits into the object (including modifications from magic + /// effects). Throws an exception, if the object can't hold other objects. + static void registerSelf(); }; } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 444fe9965..3c1c0e29a 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -325,4 +325,10 @@ namespace MWClass return info; } + + float Npc::getCapactiy (const MWWorld::Ptr& ptr) const + { + const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); + return stats.mAttributes[0].getModified()*5; + } } diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index 38b0ba03f..d2ecc7aa7 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -74,6 +74,10 @@ namespace MWClass ///< Return desired movement vector (determined based on movement settings, /// stance and stats). + virtual float getCapactiy (const MWWorld::Ptr& ptr) const; + ///< Return total weight that fits into the object (including modifications from magic + /// effects). Throws an exception, if the object can't hold other objects. + static void registerSelf(); }; } diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 151d913be..24d2d07f1 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -142,6 +142,11 @@ namespace MWWorld throw std::logic_error ("value not supported by this class"); } + float Class::getCapactiy (const MWWorld::Ptr& ptr) const + { + throw std::runtime_error ("capacity not supported by class"); + } + const Class& Class::get (const std::string& key) { std::map >::const_iterator iter = sClasses.find (key); diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index d7a2d2d75..34e61c54a 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -164,6 +164,11 @@ namespace MWWorld ///< Return trade value of the object. Throws an exception, if the object can't be traded. /// (default implementation: throws an exception) + virtual float getCapactiy (const MWWorld::Ptr& ptr) const; + ///< Return total weight that fits into the object (including modifications from magic + /// effects). Throws an exception, if the object can't hold other objects. + /// (default implementation: throws an exception) + static const Class& get (const std::string& key); ///< If there is no class for this \a key, an exception is thrown. From 7e00fea18b3666529d33a968b371b4297fb85bfc Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 15 May 2012 21:34:00 +0200 Subject: [PATCH 08/17] added getEncumbrance function --- apps/openmw/mwclass/container.cpp | 5 +++++ apps/openmw/mwclass/container.hpp | 6 +++++- apps/openmw/mwclass/creature.cpp | 17 +++++++++++++++++ apps/openmw/mwclass/creature.hpp | 6 +++++- apps/openmw/mwclass/npc.cpp | 16 ++++++++++++++++ apps/openmw/mwclass/npc.hpp | 6 +++++- apps/openmw/mwworld/class.cpp | 7 ++++++- apps/openmw/mwworld/class.hpp | 7 ++++++- 8 files changed, 65 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index 82a9212a2..34d6b6c60 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -184,4 +184,9 @@ namespace MWClass return ref->base->weight; } + + float Container::getEncumbrance (const MWWorld::Ptr& ptr) const + { + return getContainerStore (ptr).getWeight(); + } } diff --git a/apps/openmw/mwclass/container.hpp b/apps/openmw/mwclass/container.hpp index 0231ce26b..61a0d912b 100644 --- a/apps/openmw/mwclass/container.hpp +++ b/apps/openmw/mwclass/container.hpp @@ -37,7 +37,11 @@ namespace MWClass ///< Return name of the script attached to ptr virtual float getCapactiy (const MWWorld::Ptr& ptr) const; - ///< Return total weight that fits into the object (including modifications from magic + ///< Return total weight that fits into the object. Throws an exception, if the object can't + /// hold other objects. + + virtual float getEncumbrance (const MWWorld::Ptr& ptr) const; + ///< Returns total weight of objects inside this object (including modifications from magic /// effects). Throws an exception, if the object can't hold other objects. static void registerSelf(); diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index a16455430..a0b2225db 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -5,6 +5,7 @@ #include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/mechanicsmanager.hpp" +#include "../mwmechanics/magiceffects.hpp" #include "../mwbase/environment.hpp" @@ -172,4 +173,20 @@ namespace MWClass const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); return stats.mAttributes[0].getModified()*5; } + + float Creature::getEncumbrance (const MWWorld::Ptr& ptr) const + { + float weight = getContainerStore (ptr).getWeight(); + + const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); + + weight -= stats.mMagicEffects.get (MWMechanics::EffectKey (8)).mMagnitude; // feather + + weight += stats.mMagicEffects.get (MWMechanics::EffectKey (7)).mMagnitude; // burden + + if (weight<0) + weight = 0; + + return weight; + } } diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index c68d1995d..7224d3ee1 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -53,7 +53,11 @@ namespace MWClass ///< Return name of the script attached to ptr virtual float getCapactiy (const MWWorld::Ptr& ptr) const; - ///< Return total weight that fits into the object (including modifications from magic + ///< Return total weight that fits into the object. Throws an exception, if the object can't + /// hold other objects. + + virtual float getEncumbrance (const MWWorld::Ptr& ptr) const; + ///< Returns total weight of objects inside this object (including modifications from magic /// effects). Throws an exception, if the object can't hold other objects. static void registerSelf(); diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 3c1c0e29a..3bb4519c2 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -331,4 +331,20 @@ namespace MWClass const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); return stats.mAttributes[0].getModified()*5; } + + float Npc::getEncumbrance (const MWWorld::Ptr& ptr) const + { + float weight = getContainerStore (ptr).getWeight(); + + const MWMechanics::CreatureStats& stats = getCreatureStats (ptr); + + weight -= stats.mMagicEffects.get (MWMechanics::EffectKey (8)).mMagnitude; // feather + + weight += stats.mMagicEffects.get (MWMechanics::EffectKey (7)).mMagnitude; // burden + + if (weight<0) + weight = 0; + + return weight; + } } diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index d2ecc7aa7..0cfad0347 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -75,7 +75,11 @@ namespace MWClass /// stance and stats). virtual float getCapactiy (const MWWorld::Ptr& ptr) const; - ///< Return total weight that fits into the object (including modifications from magic + ///< Return total weight that fits into the object. Throws an exception, if the object can't + /// hold other objects. + + virtual float getEncumbrance (const MWWorld::Ptr& ptr) const; + ///< Returns total weight of objects inside this object (including modifications from magic /// effects). Throws an exception, if the object can't hold other objects. static void registerSelf(); diff --git a/apps/openmw/mwworld/class.cpp b/apps/openmw/mwworld/class.cpp index 24d2d07f1..5fb503847 100644 --- a/apps/openmw/mwworld/class.cpp +++ b/apps/openmw/mwworld/class.cpp @@ -144,7 +144,12 @@ namespace MWWorld float Class::getCapactiy (const MWWorld::Ptr& ptr) const { - throw std::runtime_error ("capacity not supported by class"); + throw std::runtime_error ("capacity not supported by this class"); + } + + float Class::getEncumbrance (const MWWorld::Ptr& ptr) const + { + throw std::runtime_error ("encumbrance not supported by class"); } const Class& Class::get (const std::string& key) diff --git a/apps/openmw/mwworld/class.hpp b/apps/openmw/mwworld/class.hpp index 34e61c54a..513dc942b 100644 --- a/apps/openmw/mwworld/class.hpp +++ b/apps/openmw/mwworld/class.hpp @@ -165,7 +165,12 @@ namespace MWWorld /// (default implementation: throws an exception) virtual float getCapactiy (const MWWorld::Ptr& ptr) const; - ///< Return total weight that fits into the object (including modifications from magic + ///< Return total weight that fits into the object. Throws an exception, if the object can't + /// hold other objects. + /// (default implementation: throws an exception) + + virtual float getEncumbrance (const MWWorld::Ptr& ptr) const; + ///< Returns total weight of objects inside this object (including modifications from magic /// effects). Throws an exception, if the object can't hold other objects. /// (default implementation: throws an exception) From fdfddc8be7d8b720a8eb54aed365a17bb60bd082 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 15 May 2012 21:34:32 +0200 Subject: [PATCH 09/17] some todo comment cleanup --- apps/openmw/mwclass/creature.cpp | 2 -- apps/openmw/mwclass/npc.cpp | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index a0b2225db..c2623500d 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -57,8 +57,6 @@ namespace MWClass data->mCreatureStats.mLevel = ref->base->data.level; - // \todo add initial container content - // store ptr.getRefData().setCustomData (data.release()); } diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 3bb4519c2..556798bf4 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -88,11 +88,9 @@ namespace MWClass } else { - //TODO: do something with npdt12 maybe:p + /// \todo do something with npdt12 maybe:p } - // \todo add initial container content - // store ptr.getRefData().setCustomData (data.release()); } From 6f87493df664996c7d4b07ba6b708dec45afad76 Mon Sep 17 00:00:00 2001 From: gugus Date: Thu, 17 May 2012 15:46:38 +0200 Subject: [PATCH 10/17] fix collision bug i think. It disable collision for quiet a lot of objects (maybe a little to much) --- components/nifbullet/bullet_nif_loader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/nifbullet/bullet_nif_loader.cpp b/components/nifbullet/bullet_nif_loader.cpp index e9aa626db..30cb4562d 100644 --- a/components/nifbullet/bullet_nif_loader.cpp +++ b/components/nifbullet/bullet_nif_loader.cpp @@ -139,6 +139,8 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource) handleNode(node,0,Ogre::Matrix3::IDENTITY,Ogre::Vector3::ZERO,1,hasCollisionNode,false,true); } + cShape->collide = hasCollisionNode&&cShape->collide; + struct TriangleMeshShape : public btBvhTriangleMeshShape { TriangleMeshShape(btStridingMeshInterface* meshInterface, bool useQuantizedAabbCompression) From 09ec1da0f6c02cdc5bc5ae3fc8707939525651b3 Mon Sep 17 00:00:00 2001 From: gugus Date: Thu, 17 May 2012 16:12:55 +0200 Subject: [PATCH 11/17] fix the latest commit: objects activation works again. --- libs/openengine/bullet/physic.cpp | 41 +++++++++++++++++-------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/libs/openengine/bullet/physic.cpp b/libs/openengine/bullet/physic.cpp index 42853d8cf..d30d5e9f1 100644 --- a/libs/openengine/bullet/physic.cpp +++ b/libs/openengine/bullet/physic.cpp @@ -22,7 +22,8 @@ namespace Physic COL_NOTHING = 0, //collide = shape->collide; return body; + } void PhysicEngine::addRigidBody(RigidBody* body) { - if(body->collide) + if(body) { - dynamicsWorld->addRigidBody(body,COL_WORLD,COL_WORLD|COL_ACTOR_INTERNAL|COL_ACTOR_EXTERNAL); - } - else - { - dynamicsWorld->addRigidBody(body,COL_WORLD,COL_NOTHING); - } - body->setActivationState(DISABLE_DEACTIVATION); - RigidBody* oldBody = RigidBodyMap[body->mName]; - if (oldBody != NULL) - { - dynamicsWorld->removeRigidBody(oldBody); - delete oldBody; - } + if(body->collide) + { + dynamicsWorld->addRigidBody(body,COL_WORLD,COL_WORLD|COL_ACTOR_INTERNAL|COL_ACTOR_EXTERNAL); + } + else + { + dynamicsWorld->addRigidBody(body,COL_RAYCASTING,COL_RAYCASTING|COL_WORLD); + } + body->setActivationState(DISABLE_DEACTIVATION); + RigidBody* oldBody = RigidBodyMap[body->mName]; + if (oldBody != NULL) + { + dynamicsWorld->removeRigidBody(oldBody); + delete oldBody; + } - RigidBodyMap[body->mName] = body; + RigidBodyMap[body->mName] = body; + } } void PhysicEngine::removeRigidBody(std::string name) @@ -460,7 +465,7 @@ namespace Physic float d1 = 10000.; btCollisionWorld::ClosestRayResultCallback resultCallback1(from, to); - resultCallback1.m_collisionFilterMask = COL_WORLD; + resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING; dynamicsWorld->rayTest(from, to, resultCallback1); if (resultCallback1.hasHit()) { @@ -489,7 +494,7 @@ namespace Physic std::vector< std::pair > PhysicEngine::rayTest2(btVector3& from, btVector3& to) { MyRayResultCallback resultCallback1; - resultCallback1.m_collisionFilterMask = COL_WORLD; + resultCallback1.m_collisionFilterMask = COL_WORLD|COL_RAYCASTING; dynamicsWorld->rayTest(from, to, resultCallback1); std::vector< std::pair > results = resultCallback1.results; From 6b74fec8ed4def2da942b57e6f836af94f369890 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 17 May 2012 17:13:41 +0200 Subject: [PATCH 12/17] don't do a half finished cell change, when trying to switch to an interior cell that does not exist --- apps/openmw/mwworld/scene.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 6f9f3ed3e..caaef5264 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -251,6 +251,9 @@ namespace MWWorld void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position) { std::cout << "Changing to interior\n"; + + Ptr::CellStore *cell = mWorld->getInterior(cellName); + // remove active CellStoreCollection::iterator active = mActiveCells.begin(); @@ -261,11 +264,9 @@ namespace MWWorld // Load cell. std::cout << "cellName:" << cellName << std::endl; - Ptr::CellStore *cell = mWorld->getInterior(cellName); loadCell (cell); - // adjust player mCurrentCell = cell; playerCellChange (cell, position); From ae77e7b0d84a0fa92e9a13f558d6ca0bf901efe0 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 May 2012 18:11:34 +0200 Subject: [PATCH 13/17] don't try to retrieve land data from non-predefined cells. --- apps/openmw/mwworld/scene.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index caaef5264..e4236b2f7 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -82,7 +82,11 @@ namespace MWWorld } if (!((*iter)->cell->data.flags & ESM::Cell::Interior)) - mPhysics->removeHeightField( (*iter)->cell->data.gridX, (*iter)->cell->data.gridY ); + { + ESM::Land* land = mWorld->getStore().lands.search((*iter)->cell->data.gridX,(*iter)->cell->data.gridY); + if (land) + mPhysics->removeHeightField( (*iter)->cell->data.gridX, (*iter)->cell->data.gridY ); + } } mRendering.removeCell(*iter); @@ -118,9 +122,10 @@ namespace MWWorld if (!(cell->cell->data.flags & ESM::Cell::Interior)) { ESM::Land* land = mWorld->getStore().lands.search(cell->cell->data.gridX,cell->cell->data.gridY); - mPhysics->addHeightField (land->landData->heights, - cell->cell->data.gridX, cell->cell->data.gridY, - 0, ( worldsize/(verts-1) ), verts); + if (land) + mPhysics->addHeightField (land->landData->heights, + cell->cell->data.gridX, cell->cell->data.gridY, + 0, ( worldsize/(verts-1) ), verts); } mRendering.configureAmbient(*cell); From 0afda15ce9f0e564abceef4773e724625d80fc40 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 May 2012 18:14:33 +0200 Subject: [PATCH 14/17] fix for cells that have no region. --- apps/openmw/mwgui/window_manager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index dfac55beb..610f1b2f2 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -447,7 +447,8 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell) else { const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->cell->region); - name = region->name; + if (region) + name = region->name; } map->setCellName( name ); From 375c198ebd9d350dd3d137c3faf8af7382e3e032 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 May 2012 18:21:05 +0200 Subject: [PATCH 15/17] WeatherManager: fix for cells that have no region. --- apps/openmw/mwworld/weather.cpp | 73 +++++++++++++++++---------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index bcbb96eec..316463f53 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -499,51 +499,54 @@ void WeatherManager::update(float duration) mCurrentRegion = regionstr; mWeatherUpdateTime = WeatherGlobals::mWeatherUpdateTime*3600; - std::string weather; + std::string weather = "clear"; if (mRegionOverrides.find(regionstr) != mRegionOverrides.end()) weather = mRegionOverrides[regionstr]; else { // get weather probabilities for the current region - const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.find (regionstr); + const ESM::Region *region = MWBase::Environment::get().getWorld()->getStore().regions.search (regionstr); - float clear = region->data.clear/255.f; - float cloudy = region->data.cloudy/255.f; - float foggy = region->data.foggy/255.f; - float overcast = region->data.overcast/255.f; - float rain = region->data.rain/255.f; - float thunder = region->data.thunder/255.f; - float ash = region->data.ash/255.f; - float blight = region->data.blight/255.f; - //float snow = region->data.a/255.f; - //float blizzard = region->data.b/255.f; + if (region != 0) + { + float clear = region->data.clear/255.f; + float cloudy = region->data.cloudy/255.f; + float foggy = region->data.foggy/255.f; + float overcast = region->data.overcast/255.f; + float rain = region->data.rain/255.f; + float thunder = region->data.thunder/255.f; + float ash = region->data.ash/255.f; + float blight = region->data.blight/255.f; + //float snow = region->data.a/255.f; + //float blizzard = region->data.b/255.f; - // re-scale to 100 percent - const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight;//+snow+blizzard; + // re-scale to 100 percent + const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight;//+snow+blizzard; - float random = ((rand()%100)/100.f) * total; + float random = ((rand()%100)/100.f) * total; - //if (random >= snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear) - // weather = "blizzard"; - //else if (random >= blight+ash+thunder+rain+overcast+foggy+cloudy+clear) - // weather = "snow"; - /*else*/ if (random >= ash+thunder+rain+overcast+foggy+cloudy+clear) - weather = "blight"; - else if (random >= thunder+rain+overcast+foggy+cloudy+clear) - weather = "ashstorm"; - else if (random >= rain+overcast+foggy+cloudy+clear) - weather = "thunderstorm"; - else if (random >= overcast+foggy+cloudy+clear) - weather = "rain"; - else if (random >= foggy+cloudy+clear) - weather = "overcast"; - else if (random >= cloudy+clear) - weather = "foggy"; - else if (random >= clear) - weather = "cloudy"; - else - weather = "clear"; + //if (random >= snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear) + // weather = "blizzard"; + //else if (random >= blight+ash+thunder+rain+overcast+foggy+cloudy+clear) + // weather = "snow"; + /*else*/ if (random >= ash+thunder+rain+overcast+foggy+cloudy+clear) + weather = "blight"; + else if (random >= thunder+rain+overcast+foggy+cloudy+clear) + weather = "ashstorm"; + else if (random >= rain+overcast+foggy+cloudy+clear) + weather = "thunderstorm"; + else if (random >= overcast+foggy+cloudy+clear) + weather = "rain"; + else if (random >= foggy+cloudy+clear) + weather = "overcast"; + else if (random >= cloudy+clear) + weather = "foggy"; + else if (random >= clear) + weather = "cloudy"; + else + weather = "clear"; + } } setWeather(weather, false); From c9aa0ca1f42300c73155f618bab8deb52bd5cd95 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 May 2012 19:54:09 +0200 Subject: [PATCH 16/17] don't create terrain if there is no land data, also fixes a water disappearing issue and a sound exception if cells with no region --- apps/openmw/mwrender/renderingmanager.cpp | 7 +++- apps/openmw/mwrender/terrain.cpp | 49 +++++++++-------------- apps/openmw/mwsound/soundmanager.cpp | 5 ++- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index a95a179c6..18d512ac8 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -11,6 +11,7 @@ #include "../mwworld/world.hpp" // these includes can be removed once the static-hack is gone #include "../mwworld/ptr.hpp" +#include "../mwbase/environment.hpp" #include #include @@ -229,7 +230,10 @@ void RenderingManager::update (float duration){ mWater->update(); } void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){ - if(store->cell->data.flags & store->cell->HasWater){ + if(store->cell->data.flags & store->cell->HasWater + || ((!(store->cell->data.flags & ESM::Cell::Interior)) + && !MWBase::Environment::get().getWorld()->getStore().lands.search(store->cell->data.gridX,store->cell->data.gridY) )) // always use water, if the cell does not have land. + { if(mWater == 0) mWater = new MWRender::Water(mRendering.getCamera(), mSkyManager, store->cell); else @@ -238,7 +242,6 @@ void RenderingManager::waterAdded (MWWorld::Ptr::CellStore *store){ } else removeWater(); - } void RenderingManager::setWaterHeight(const float height) diff --git a/apps/openmw/mwrender/terrain.cpp b/apps/openmw/mwrender/terrain.cpp index 90d853f75..56eff4a9a 100644 --- a/apps/openmw/mwrender/terrain.cpp +++ b/apps/openmw/mwrender/terrain.cpp @@ -110,12 +110,12 @@ namespace MWRender const int cellY = store->cell->getGridY(); ESM::Land* land = MWBase::Environment::get().getWorld()->getStore().lands.search(cellX, cellY); - if ( land != NULL ) + if (land == NULL) // no land data means we're not going to create any terrain. + return; + + if (!land->dataLoaded) { - if (!land->dataLoaded) - { - land->loadData(); - } + land->loadData(); } //split the cell terrain into four segments @@ -138,25 +138,18 @@ namespace MWRender mLandSize*mLandSize, MEMCATEGORY_GEOMETRY); - if ( land != NULL ) + //copy the height data row by row + for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ ) { - //copy the height data row by row - for ( int terrainCopyY = 0; terrainCopyY < mLandSize; terrainCopyY++ ) - { - //the offset of the current segment - const size_t yOffset = y * (mLandSize-1) * ESM::Land::LAND_SIZE + - //offset of the row - terrainCopyY * ESM::Land::LAND_SIZE; - const size_t xOffset = x * (mLandSize-1); + //the offset of the current segment + const size_t yOffset = y * (mLandSize-1) * ESM::Land::LAND_SIZE + + //offset of the row + terrainCopyY * ESM::Land::LAND_SIZE; + const size_t xOffset = x * (mLandSize-1); - memcpy(&terrainData.inputFloat[terrainCopyY*mLandSize], - &land->landData->heights[yOffset + xOffset], - mLandSize*sizeof(float)); - } - } - else - { - memset(terrainData.inputFloat, 0, mLandSize*mLandSize*sizeof(float)); + memcpy(&terrainData.inputFloat[terrainCopyY*mLandSize], + &land->landData->heights[yOffset + xOffset], + mLandSize*sizeof(float)); } std::map indexes; @@ -179,7 +172,7 @@ namespace MWRender terrain->setVisibilityFlags(RV_Terrain); terrain->setRenderQueueGroup(RQG_Main); - if ( land && land->landData->usingColours ) + if ( land->landData->usingColours ) { // disable or enable global colour map (depends on available vertex colours) mActiveProfile->setGlobalColourMapEnabled(true); @@ -196,10 +189,6 @@ namespace MWRender //mat = terrain->_getCompositeMapMaterial(); //mat->getTechnique(0)->getPass(0)->getTextureUnitState(1)->setTextureName( vertex->getName() ); } - else - { - mActiveProfile->setGlobalColourMapEnabled(false); - } } } } @@ -215,8 +204,10 @@ namespace MWRender { for ( int y = 0; y < 2; y++ ) { - mTerrainGroup.unloadTerrain(store->cell->getGridX() * 2 + x, - store->cell->getGridY() * 2 + y); + int terrainX = store->cell->getGridX() * 2 + x; + int terrainY = store->cell->getGridY() * 2 + y; + if (mTerrainGroup.getTerrain(terrainX, terrainY) != NULL) + mTerrainGroup.unloadTerrain(terrainX, terrainY); } } } diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index 9eefc7a28..8deab3c04 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -433,7 +433,10 @@ namespace MWSound total = 0; } - const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.find(regionName); + const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.search(regionName); + if (regn == NULL) + return; + std::vector::const_iterator soundIter; if(total == 0) { From 52e5e14654ed786776d595538bc21335f1c4464a Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 17 May 2012 23:42:09 +0200 Subject: [PATCH 17/17] use GMST sDefaultCellname for the map window when cell has no region or name. --- apps/openmw/mwgui/window_manager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 610f1b2f2..2200448e6 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -449,6 +449,8 @@ void WindowManager::changeCell(MWWorld::Ptr::CellStore* cell) const ESM::Region* region = MWBase::Environment::get().getWorld()->getStore().regions.search(cell->cell->region); if (region) name = region->name; + else + name = getGameSettingString("sDefaultCellname", "Wilderness"); } map->setCellName( name );