diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 4f77c1b1ad..a36b6e12f5 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -248,7 +248,7 @@ int main(int argc, char**argv) { #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX || OGRE_PLATFORM == OGRE_PLATFORM_APPLE // Unix crash catcher - if (!is_debugger_attached()) + if ((argc == 2 && strcmp(argv[1], "--cc-handle-crash") == 0) || !is_debugger_attached()) { int s[5] = { SIGSEGV, SIGILL, SIGFPE, SIGBUS, SIGABRT }; cc_install_handlers(argc, argv, 5, s, "crash.log", NULL); diff --git a/apps/openmw/mwgui/companionwindow.cpp b/apps/openmw/mwgui/companionwindow.cpp index 9698608d69..a0a34108eb 100644 --- a/apps/openmw/mwgui/companionwindow.cpp +++ b/apps/openmw/mwgui/companionwindow.cpp @@ -86,12 +86,13 @@ void CompanionWindow::onBackgroundSelected() void CompanionWindow::open(const MWWorld::Ptr& npc) { mPtr = npc; - setTitle(MWWorld::Class::get(npc).getName(npc)); updateEncumbranceBar(); mModel = new CompanionItemModel(npc); mSortModel = new SortFilterItemModel(mModel); mItemView->setModel(mSortModel); + + setTitle(MWWorld::Class::get(npc).getName(npc)); } void CompanionWindow::onFrame() diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 5d864752fc..19ed4dbc00 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -220,11 +220,13 @@ namespace MWGui mDisposeCorpseButton->setVisible(loot); - setTitle(MWWorld::Class::get(container).getName(container)); - mSortModel = new SortFilterItemModel(mModel); mItemView->setModel (mSortModel); + + // Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last + // or we end up using a possibly invalid model. + setTitle(MWWorld::Class::get(container).getName(container)); } void ContainerWindow::onCloseButtonClicked(MyGUI::Widget* _sender) diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index c179236087..65e3917ed5 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -82,7 +82,6 @@ namespace MWGui void TradeWindow::startTrade(const MWWorld::Ptr& actor) { mPtr = actor; - setTitle(MWWorld::Class::get(actor).getName(actor)); mCurrentBalance = 0; mCurrentMerchantOffer = 0; @@ -99,6 +98,10 @@ namespace MWGui mItemView->setModel (mSortModel); updateLabels(); + + // Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last + // or we end up using a possibly invalid model. + setTitle(MWWorld::Class::get(actor).getName(actor)); } void TradeWindow::onFilterChanged(MyGUI::Widget* _sender) diff --git a/apps/openmw/mwmechanics/magiceffects.hpp b/apps/openmw/mwmechanics/magiceffects.hpp index 9cdc27514e..58f023ebac 100644 --- a/apps/openmw/mwmechanics/magiceffects.hpp +++ b/apps/openmw/mwmechanics/magiceffects.hpp @@ -24,8 +24,6 @@ namespace MWMechanics int mId; int mArg; // skill or ability - // TODO: Add caster here for Absorb effects? - EffectKey(); EffectKey (int id, int arg = -1) : mId (id), mArg (arg) {} diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index cc92e62489..10c925b36a 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1045,7 +1045,9 @@ void Animation::updateEffects(float duration) NifOgre::ObjectList& objects = it->mObjects; for(size_t i = 0; i < objects.mControllers.size() ;i++) { - static_cast (objects.mControllers[i].getSource().get())->addTime(duration); + EffectAnimationValue* value = dynamic_cast(objects.mControllers[i].getSource().get()); + if (value) + value->addTime(duration); objects.mControllers[i].update(); } @@ -1058,7 +1060,9 @@ void Animation::updateEffects(float duration) float remainder = objects.mControllers[0].getSource()->getValue() - objects.mMaxControllerLength; for(size_t i = 0; i < objects.mControllers.size() ;i++) { - static_cast (objects.mControllers[i].getSource().get())->resetTime(remainder); + EffectAnimationValue* value = dynamic_cast(objects.mControllers[i].getSource().get()); + if (value) + value->resetTime(remainder); } } else diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index e6c4c1ef08..2dd0a9b930 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2166,7 +2166,10 @@ namespace MWWorld if (!contact.first.isEmpty()) { if (contact.first.getClass().isActor()) - contact.first.getClass().getCreatureStats(contact.first).getActiveSpells().addSpell(selectedSpell, contact.first, actor, ESM::RT_Touch, sourceName); + { + if (!contact.first.getClass().getCreatureStats(contact.first).isDead()) + contact.first.getClass().getCreatureStats(contact.first).getActiveSpells().addSpell(selectedSpell, contact.first, actor, ESM::RT_Touch, sourceName); + } else { // We hit a non-actor, e.g. a door. Only instant effects are relevant. diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp index 46e2a8555d..f601915395 100644 --- a/components/esm/loadmgef.cpp +++ b/components/esm/loadmgef.cpp @@ -132,8 +132,6 @@ short MagicEffect::getResistanceEffect(short effect) short MagicEffect::getWeaknessEffect(short effect) { std::map effects; - effects[DisintegrateArmor] = Sanctuary; - effects[DisintegrateWeapon] = Sanctuary; for (int i=0; i<5; ++i) effects[DrainAttribute+i] = WeaknessToMagicka;