From 42b7846f818d394672d9d28522a729a577b5313c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 23 Mar 2018 17:49:31 +0300 Subject: [PATCH 01/11] Replace a redundant playerAllies check with a boolean (Fixes #4229) --- apps/openmw/mwmechanics/actors.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 7a1e7270d..1032afd95 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -391,7 +391,7 @@ namespace MWMechanics { // Player followers and escorters with high fight should not initiate combat with the player or with // other player followers or escorters - if (std::find(playerAllies.begin(), playerAllies.end(), actor1) == playerAllies.end()) + if (!isPlayerFollowerOrEscorter) aggressive = MWBase::Environment::get().getMechanicsManager()->isAggressive(actor1, actor2); } } From 5a3086b0c6dcfa108d23e124125025b4760dfc11 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 23 Mar 2018 23:52:08 +0300 Subject: [PATCH 02/11] Auto-detect the actual Morrowind assets path (Fixes #4336) --- apps/wizard/mainwizard.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index b99f151aa..0f8fb0c49 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -62,10 +62,11 @@ Wizard::MainWizard::MainWizard(QWidget *parent) : setupInstallations(); setupPages(); - const boost::filesystem::path& installedPath = mCfgMgr.getInstallPath(); - if (!installedPath.empty()) + const boost::filesystem::path& installationPath = mCfgMgr.getInstallPath(); + if (!installationPath.empty()) { - addInstallation(toQString(installedPath)); + const boost::filesystem::path& dataPath = installationPath / "Data Files"; + addInstallation(toQString(dataPath)); } } From 41f89c84f8663e52096f07b946d325e135d51399 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 24 Mar 2018 20:21:06 +0300 Subject: [PATCH 03/11] Don't move the player if opposite direction keys are held down at the same time (Fixes #4233) --- apps/openmw/mwinput/inputmanagerimp.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 3b4ff25a0..507e97a6a 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -524,30 +524,29 @@ namespace MWInput isRunning = xAxis > .75 || xAxis < .25 || yAxis > .75 || yAxis < .25; if(triedToMove) resetIdleTime(); - if (actionIsActive(A_MoveLeft)) + if (actionIsActive(A_MoveLeft) && !actionIsActive(A_MoveRight)) { triedToMove = true; mPlayer->setLeftRight (-1); } - else if (actionIsActive(A_MoveRight)) + else if (actionIsActive(A_MoveRight) && !actionIsActive(A_MoveLeft)) { triedToMove = true; mPlayer->setLeftRight (1); } - if (actionIsActive(A_MoveForward)) + if (actionIsActive(A_MoveForward) && !actionIsActive(A_MoveBackward)) { triedToMove = true; mPlayer->setAutoMove (false); mPlayer->setForwardBackward (1); } - else if (actionIsActive(A_MoveBackward)) + else if (actionIsActive(A_MoveBackward) && !actionIsActive(A_MoveForward)) { triedToMove = true; mPlayer->setAutoMove (false); mPlayer->setForwardBackward (-1); } - else if(mPlayer->getAutoMove()) { triedToMove = true; From b6a2589e7b6c1fa369c33989b1600d5d1eee6709 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 27 Mar 2018 13:34:35 +0300 Subject: [PATCH 04/11] Don't apply harmful spell effects on the player in god mode (fixes #4264) --- apps/openmw/mwmechanics/spellcasting.cpp | 68 ++++++++---------------- 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index d864dc619..d2815de93 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -489,6 +489,9 @@ namespace MWMechanics MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicTargetResisted}"); } + if (target == getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState()) + magnitudeMult = 0; + // If player is attempting to cast a harmful spell, show the target's HP bar if (castByPlayer && target != caster) MWBase::Environment::get().getWindowManager()->setEnemy(target); @@ -877,20 +880,18 @@ namespace MWMechanics const float normalizedEncumbrance = mCaster.getClass().getNormalizedEncumbrance(mCaster); float fatigueLoss = spell->mData.mCost * (fFatigueSpellBase + normalizedEncumbrance * fFatigueSpellMult); - fatigue.setCurrent(fatigue.getCurrent() - fatigueLoss); stats.setFatigue(fatigue); + fatigue.setCurrent(fatigue.getCurrent() - fatigueLoss); + stats.setFatigue(fatigue); bool fail = false; // Check success - if (!(mCaster == getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState())) + float successChance = getSpellSuccessChance(spell, mCaster); + if (Misc::Rng::roll0to99() >= successChance) { - float successChance = getSpellSuccessChance(spell, mCaster); - if (Misc::Rng::roll0to99() >= successChance) - { - if (mCaster == getPlayer()) - MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}"); - fail = true; - } + if (mCaster == getPlayer()) + MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicSkillFail}"); + fail = true; } if (fail) @@ -1111,8 +1112,6 @@ namespace MWMechanics bool receivedMagicDamage = false; - bool godmode = actor == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState(); - switch (effectKey.mId) { case ESM::MagicEffect::DamageAttribute: @@ -1135,40 +1134,25 @@ namespace MWMechanics adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::RestoreHealth, magnitude); break; case ESM::MagicEffect::DamageHealth: - if (!godmode) - { - receivedMagicDamage = true; - adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); - } - + receivedMagicDamage = true; + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); break; case ESM::MagicEffect::DamageMagicka: case ESM::MagicEffect::DamageFatigue: - if (!godmode) - { - adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); - } - + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::DamageHealth, -magnitude); break; case ESM::MagicEffect::AbsorbHealth: - if (!godmode) - { - if (magnitude > 0.f) - receivedMagicDamage = true; - adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); - } + if (magnitude > 0.f) + receivedMagicDamage = true; + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); break; case ESM::MagicEffect::AbsorbMagicka: case ESM::MagicEffect::AbsorbFatigue: - if (!godmode) - { - adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); - } - + adjustDynamicStat(creatureStats, effectKey.mId-ESM::MagicEffect::AbsorbHealth, -magnitude); break; case ESM::MagicEffect::DisintegrateArmor: @@ -1191,6 +1175,7 @@ namespace MWMechanics if (disintegrateSlot(actor, priorities[i], magnitude)) break; } + break; } case ESM::MagicEffect::DisintegrateWeapon: @@ -1213,12 +1198,9 @@ namespace MWMechanics if (weather > 1) damageScale *= fMagicSunBlockedMult; - if (!godmode) - { - adjustDynamicStat(creatureStats, 0, -magnitude * damageScale); - if (magnitude * damageScale > 0.f) - receivedMagicDamage = true; - } + adjustDynamicStat(creatureStats, 0, -magnitude * damageScale); + if (magnitude * damageScale > 0.f) + receivedMagicDamage = true; break; } @@ -1228,12 +1210,8 @@ namespace MWMechanics case ESM::MagicEffect::FrostDamage: case ESM::MagicEffect::Poison: { - if (!godmode) - { - adjustDynamicStat(creatureStats, 0, -magnitude); - receivedMagicDamage = true; - } - + adjustDynamicStat(creatureStats, 0, -magnitude); + receivedMagicDamage = true; break; } From 2d119e834aef46dbdf241f8e94f63c45775b7543 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 27 Mar 2018 12:24:32 +0300 Subject: [PATCH 05/11] Add vanilla absorb attribute behavior option, on by default (Fixes #4135) --- apps/openmw/mwmechanics/spellcasting.cpp | 10 +++++++--- docs/source/reference/modding/settings/game.rst | 14 ++++++++++++++ files/settings-default.cfg | 3 +++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index d864dc619..f43fd906d 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/soundmanager.hpp" @@ -567,9 +568,12 @@ namespace MWMechanics ActiveSpells::ActiveEffect effect_ = effect; effect_.mMagnitude *= -1; absorbEffects.push_back(effect_); - // Also make sure to set casterActorId = target, so that the effect on the caster gets purged when the target dies - caster.getClass().getCreatureStats(caster).getActiveSpells().addSpell("", true, - absorbEffects, mSourceName, target.getClass().getCreatureStats(target).getActorId()); + if (reflected && Settings::Manager::getBool("classic reflected absorb attribute behavior", "Game")) + target.getClass().getCreatureStats(target).getActiveSpells().addSpell("", true, + absorbEffects, mSourceName, caster.getClass().getCreatureStats(caster).getActorId()); + else + caster.getClass().getCreatureStats(caster).getActiveSpells().addSpell("", true, + absorbEffects, mSourceName, target.getClass().getCreatureStats(target).getActorId()); } } } diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index e1d5d75f6..ac8be0a82 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -97,6 +97,20 @@ and values greater than 500 will result in the player inflicting no damage. This setting can be controlled in game with the Difficulty slider in the Prefs panel of the Options menu. +classic reflect absorb attribute behavior +----------------------------------------- + +:Type: boolean +:Range: True/False +:Default: True + +If this setting is true, "Absorb Attribute" spells which were reflected by the target are not "mirrored", +and the caster will absorb their own attribute resulting in no effect on both the caster and the target. +This makes the gameplay as a mage easier, but these spells become imbalanced. +This is how the original Morrowind behaves. + +This setting can only be configured by editing the settings configuration file. + show effect duration -------------------- diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 8a28c42e4..f6ee4258b 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -173,6 +173,9 @@ best attack = false # Difficulty. Expressed as damage dealt and received. (e.g. -100 to 100). difficulty = 0 +# Replicate how reflected "absorb attribute" spells do not have any effect in Morrowind engine. The caster absorbs the attribute from themselves. +classic reflect absorb attribute behavior = true + # Show duration of magic effect and lights in the spells window. show effect duration = false From 9193ff4d159bc34ced775afbdc30ed95192f2591 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 28 Mar 2018 13:59:05 +0200 Subject: [PATCH 06/11] Reworded one of the descriptions --- docs/source/reference/modding/settings/game.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index 45ac81d64..d95fdd4ef 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -90,9 +90,9 @@ difficulty This setting adjusts the difficulty of the game and is intended to be in the range -100 to 100 inclusive. Given the default game setting for fDifficultyMult of 5.0, a value of -100 results in the player taking 80% of the usual damage, doing 6 times the normal damage. -A value of 100 results in the player taking 6 times as much damage, but inflicting only 80% of the usual damage. -Values less than -500 will result in the player receiving no damage, -and values greater than 500 will result in the player inflicting no damage. +A value of 100 results in the player taking 6 times as much damage, while inflicting only 80% of the usual damage. +Values below -500 will result in the player receiving no damage, +and values above 500 will result in the player inflicting no damage. This setting can be controlled in game with the Difficulty slider in the Prefs panel of the Options menu. From be542507f8c786a24a06dfc69ab337f95ff1b098 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Wed, 28 Mar 2018 15:43:51 +0300 Subject: [PATCH 07/11] Make hasMaster() behavior consistent with isGameFile() (fixes #3618) --- components/config/gamesettings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/config/gamesettings.cpp b/components/config/gamesettings.cpp index b35612ee4..29dbe0391 100644 --- a/components/config/gamesettings.cpp +++ b/components/config/gamesettings.cpp @@ -493,8 +493,10 @@ bool Config::GameSettings::hasMaster() { bool result = false; QStringList content = mSettings.values(QString(Config::GameSettings::sContentKey)); - for (int i = 0; i < content.count(); ++i) { - if (content.at(i).contains(".omwgame") || content.at(i).contains(".esm")) { + for (int i = 0; i < content.count(); ++i) + { + if (content.at(i).endsWith(QLatin1String(".omwgame"), Qt::CaseInsensitive) || content.at(i).endsWith(QLatin1String(".esm"), Qt::CaseInsensitive)) + { result = true; break; } From 76f50312f26a8accfee4171137cd17a7d39a8316 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 30 Mar 2018 00:02:52 +0300 Subject: [PATCH 08/11] Remove a redundant check --- apps/openmw/mwworld/containerstore.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index 981f63e34..dd5d7a853 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -256,11 +256,7 @@ bool MWWorld::ContainerStore::stacks(const ConstPtr& ptr1, const ConstPtr& ptr2) MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add(const std::string &id, int count, const Ptr &actorPtr) { MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), id, count); - // a bit pointless to set owner for the player - if (actorPtr != MWMechanics::getPlayer()) - return add(ref.getPtr(), count, actorPtr, true); - else - return add(ref.getPtr(), count, actorPtr, false); + return add(ref.getPtr(), count, actorPtr, true); } MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr, int count, const Ptr& actorPtr, bool setOwner) From e6d9bce5199e7182faf382ab9699a72aba7f80b5 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 30 Mar 2018 14:05:36 +0300 Subject: [PATCH 09/11] Implement fWerewolfHealth GMST (fixes #4142) --- .../mwmechanics/mechanicsmanagerimp.cpp | 6 ++-- apps/openmw/mwworld/player.cpp | 34 ++++++++++++------- apps/openmw/mwworld/player.hpp | 8 ++--- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index bd5fa1b11..c191af30b 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1719,11 +1719,11 @@ namespace MWMechanics { if (werewolf) { - player->saveSkillsAttributes(); - player->setWerewolfSkillsAttributes(); + player->saveStats(); + player->setWerewolfStats(); } else - player->restoreSkillsAttributes(); + player->restoreStats(); } // Werewolfs can not cast spells, so we need to unset the prepared spell if there is one. diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index 19bf7f55e..34c5f713d 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -47,37 +47,45 @@ namespace MWWorld mPlayer.mData.setPosition(playerPos); } - void Player::saveSkillsAttributes() + void Player::saveStats() { MWMechanics::NpcStats& stats = getPlayer().getClass().getNpcStats(getPlayer()); + for (int i=0; i& gmst = MWBase::Environment::get().getWorld()->getStore().get(); + MWMechanics::CreatureStats& creatureStats = getPlayer().getClass().getCreatureStats(getPlayer()); + MWMechanics::NpcStats& npcStats = getPlayer().getClass().getNpcStats(getPlayer()); + MWMechanics::DynamicStat health = creatureStats.getDynamic(0); + creatureStats.setHealth(int(health.getBase() / gmst.find("fWereWolfHealth")->getFloat())); for (int i=0; i& gmst = MWBase::Environment::get().getWorld()->getStore().get(); - MWMechanics::NpcStats& stats = getPlayer().getClass().getNpcStats(getPlayer()); + MWMechanics::CreatureStats& creatureStats = getPlayer().getClass().getCreatureStats(getPlayer()); + MWMechanics::NpcStats& npcStats = getPlayer().getClass().getNpcStats(getPlayer()); + MWMechanics::DynamicStat health = creatureStats.getDynamic(0); + creatureStats.setHealth(int(health.getBase() * gmst.find("fWereWolfHealth")->getFloat())); for(size_t i = 0;i < ESM::Attribute::Length;++i) { // Oh, Bethesda. It's "Intelligence". std::string name = "fWerewolf"+((i==ESM::Attribute::Intelligence) ? std::string("Intellegence") : ESM::Attribute::sAttributeNames[i]); - MWMechanics::AttributeValue value = stats.getAttribute(i); + MWMechanics::AttributeValue value = npcStats.getAttribute(i); value.setBase(int(gmst.find(name)->getFloat())); - stats.setAttribute(i, value); + npcStats.setAttribute(i, value); } for(size_t i = 0;i < ESM::Skill::Length;i++) @@ -90,9 +98,9 @@ namespace MWWorld std::string name = "fWerewolf"+((i==ESM::Skill::Mercantile) ? std::string("Merchantile") : ESM::Skill::sSkillNames[i]); - MWMechanics::SkillValue value = stats.getSkill(i); + MWMechanics::SkillValue value = npcStats.getSkill(i); value.setBase(int(gmst.find(name)->getFloat())); - stats.setSkill(i, value); + npcStats.setSkill(i, value); } } @@ -366,8 +374,8 @@ namespace MWWorld if (player.mObject.mNpcStats.mWerewolfDeprecatedData && player.mObject.mNpcStats.mIsWerewolf) { - saveSkillsAttributes(); - setWerewolfSkillsAttributes(); + saveStats(); + setWerewolfStats(); } getPlayer().getClass().getCreatureStats(getPlayer()).getAiSequence().clear(); diff --git a/apps/openmw/mwworld/player.hpp b/apps/openmw/mwworld/player.hpp index 4ba66e37e..aabbe7015 100644 --- a/apps/openmw/mwworld/player.hpp +++ b/apps/openmw/mwworld/player.hpp @@ -46,7 +46,7 @@ namespace MWWorld int mCurrentCrimeId; // the id assigned witnesses int mPaidCrimeId; // the last id paid off (0 bounty) - // Saved skills and attributes prior to becoming a werewolf + // Saved stats prior to becoming a werewolf MWMechanics::SkillValue mSaveSkills[ESM::Skill::Length]; MWMechanics::AttributeValue mSaveAttributes[ESM::Attribute::Length]; @@ -56,9 +56,9 @@ namespace MWWorld Player(const ESM::NPC *player); - void saveSkillsAttributes(); - void restoreSkillsAttributes(); - void setWerewolfSkillsAttributes(); + void saveStats(); + void restoreStats(); + void setWerewolfStats(); // For mark/recall magic effects void markPosition (CellStore* markedCell, const ESM::Position& markedPosition); From baaf65bc2cfb9f76f460d8c3aa62711d37e372a0 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 31 Mar 2018 02:38:36 +0300 Subject: [PATCH 10/11] Add vanilla enchanted weaponry behavior option, on by default (fixes #4136) --- apps/openmw/mwmechanics/combat.cpp | 7 ++++++- docs/source/reference/modding/settings/game.rst | 12 ++++++++++++ files/settings-default.cfg | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/combat.cpp b/apps/openmw/mwmechanics/combat.cpp index 13cd4232d..ac34c658b 100644 --- a/apps/openmw/mwmechanics/combat.cpp +++ b/apps/openmw/mwmechanics/combat.cpp @@ -1,6 +1,7 @@ #include "combat.hpp" #include +#include #include @@ -155,7 +156,11 @@ namespace MWMechanics if (!(weapon.get()->mBase->mData.mFlags & ESM::Weapon::Silver || weapon.get()->mBase->mData.mFlags & ESM::Weapon::Magical)) - damage *= multiplier; + { + if (weapon.getClass().getEnchantment(weapon).empty() + || !Settings::Manager::getBool("enchanted weapons are magical", "Game")) + damage *= multiplier; + } if ((weapon.get()->mBase->mData.mFlags & ESM::Weapon::Silver) && actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) diff --git a/docs/source/reference/modding/settings/game.rst b/docs/source/reference/modding/settings/game.rst index e1d5d75f6..e0ac4b6da 100644 --- a/docs/source/reference/modding/settings/game.rst +++ b/docs/source/reference/modding/settings/game.rst @@ -109,6 +109,18 @@ The remaining duration is displayed in the tooltip by hovering over the magical The default value is false. This setting can only be configured by editing the settings configuration file. +enchanted weapons are magical +----------------------------- + +:Type: boolean +:Range: True/False +:Default: True + +Makes enchanted weapons without Magical flag bypass normal weapons resistance (and weakness) certain creatures have. +This is how original Morrowind behaves. + +This setting can only be configured by editing the settings configuration file. + prevent merchant equipping -------------------------- diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 8a28c42e4..8386f22c1 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -179,6 +179,9 @@ show effect duration = false # Prevents merchants from equipping items that are sold to them. prevent merchant equipping = false +# Make enchanted weaponry without Magical flag bypass normal weapons resistance +enchanted weapons are magical = true + # Makes player followers and escorters start combat with enemies who have started combat with them # or the player. Otherwise they wait for the enemies or the player to do an attack first. followers attack on sight = false From 14daadded7c2f8bdcac9cb0acfc46713b023d57a Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 1 Apr 2018 21:50:45 +0300 Subject: [PATCH 11/11] Add virtual destructors To fix warnings: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:588:8: warning: delete called on non-final 'NifOsg::ControllerFunction' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] delete __p; ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count' requested here : __shared_count(__p) ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count' requested here : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type()) ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr.h:129:25: note: in instantiation of function template specialization 'std::__shared_ptr::__shared_ptr' requested here shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { } ^ /home/elsid/dev/openmw/components/nifosg/nifloader.cpp:242:39: note: in instantiation of function template specialization 'std::shared_ptr::shared_ptr' requested here callback->setFunction(std::shared_ptr(new NifOsg::ControllerFunction(key))); ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:78:2: warning: delete called on non-final 'MWGui::ResponseCallback' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] delete __ptr; ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:268:4: note: in instantiation of member function 'std::default_delete::operator()' requested here get_deleter()(__ptr); ^ /home/elsid/dev/openmw/apps/openmw/mwgui/dialogue.cpp:58:23: note: in instantiation of member function 'std::unique_ptr >::~unique_ptr' requested here PersuasionDialog::PersuasionDialog(ResponseCallback* callback) ^ --- apps/openmw/mwbase/dialoguemanager.hpp | 1 + components/sceneutil/controller.hpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/apps/openmw/mwbase/dialoguemanager.hpp b/apps/openmw/mwbase/dialoguemanager.hpp index a9afae786..7bace3790 100644 --- a/apps/openmw/mwbase/dialoguemanager.hpp +++ b/apps/openmw/mwbase/dialoguemanager.hpp @@ -39,6 +39,7 @@ namespace MWBase class ResponseCallback { public: + virtual ~ResponseCallback() = default; virtual void addResponse(const std::string& title, const std::string& text) = 0; }; diff --git a/components/sceneutil/controller.hpp b/components/sceneutil/controller.hpp index 775cb23b0..d02b65cf1 100644 --- a/components/sceneutil/controller.hpp +++ b/components/sceneutil/controller.hpp @@ -25,6 +25,8 @@ namespace SceneUtil class ControllerFunction { public: + virtual ~ControllerFunction() = default; + virtual float calculate(float input) const = 0; /// Get the "stop time" of the controller function, typically the maximum of the calculate() function.