From 004660be3db5f42b5ff109f23c4c7833259bfb4a Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 2 Jun 2021 20:33:29 +0200 Subject: [PATCH 01/13] Don't unsummon creatures not found within the active cells --- apps/openmw/mwmechanics/summoning.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/summoning.cpp b/apps/openmw/mwmechanics/summoning.cpp index 9f65f3d6c..facadcb1a 100644 --- a/apps/openmw/mwmechanics/summoning.cpp +++ b/apps/openmw/mwmechanics/summoning.cpp @@ -152,7 +152,7 @@ namespace MWMechanics continue; } MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->searchPtrViaActorId(it->second); - if (ptr.isEmpty() || (ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished())) + if (!ptr.isEmpty() && ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()) { // Purge the magic effect so a new creature can be summoned if desired const ESM::SummonKey& key = it->first; From 7f4f2c042e6f6947e16db2eab35e600889319497 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 4 Jun 2021 23:15:50 +0200 Subject: [PATCH 02/13] Use sizeof(GLfloat) instead of sizeof(GL_FLOAT) GL_FLOAT is an enum, with the value 0x1406, while GLFloat is the actual type. Source: https://www.khronos.org/opengl/wiki/OpenGL_Type --- components/sceneutil/lightmanager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index c4233059c..2c83c43fe 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -158,7 +158,7 @@ namespace SceneUtil static constexpr int queryBlockSize(int sz) { - return 3 * osg::Vec4::num_components * sizeof(GL_FLOAT) * sz; + return 3 * osg::Vec4::num_components * sizeof(GLfloat) * sz; } void setCachedSunPos(const osg::Vec4& pos) @@ -215,9 +215,9 @@ namespace SceneUtil } Offsets(int offsetColors, int offsetPosition, int offsetAttenuationRadius, int stride) - : mStride((offsetAttenuationRadius + sizeof(GL_FLOAT) * osg::Vec4::num_components + stride) / 4) + : mStride((offsetAttenuationRadius + sizeof(GLfloat) * osg::Vec4::num_components + stride) / 4) { - constexpr auto sizeofFloat = sizeof(GL_FLOAT); + constexpr auto sizeofFloat = sizeof(GLfloat); const auto diffuseOffset = offsetColors / sizeofFloat; mValues[Diffuse] = diffuseOffset; From 89e0bfd1a41cff29fcb75abb2ce90166e1246059 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 6 Jun 2021 12:45:42 +0200 Subject: [PATCH 03/13] Purge summon effects on dispose --- apps/openmw/mwgui/container.cpp | 19 +++++++++++++++++++ apps/openmw/mwmechanics/summoning.cpp | 18 +++++++++++------- apps/openmw/mwmechanics/summoning.hpp | 2 ++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 16b38eaf9..4cdd8b137 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -12,7 +12,9 @@ #include "../mwworld/class.hpp" #include "../mwworld/inventorystore.hpp" +#include "../mwmechanics/aipackage.hpp" #include "../mwmechanics/creaturestats.hpp" +#include "../mwmechanics/summoning.hpp" #include "../mwscript/interpretercontext.hpp" @@ -264,6 +266,23 @@ namespace MWGui for (const auto& creature : creatureMap) MWBase::Environment::get().getMechanicsManager()->cleanupSummonedCreature(ptr, creature.second); creatureMap.clear(); + + // Check if we are a summon and inform our master we've bit the dust + for(const auto& package : creatureStats.getAiSequence()) + { + if(package->followTargetThroughDoors() && !package->getTarget().isEmpty()) + { + const auto& summoner = package->getTarget(); + auto& summons = summoner.getClass().getCreatureStats(summoner).getSummonedCreatureMap(); + auto it = std::find_if(summons.begin(), summons.end(), [&] (const auto& entry) { return entry.second == creatureStats.getActorId(); }); + if(it != summons.end()) + { + MWMechanics::purgeSummonEffect(summoner, *it); + summons.erase(it); + break; + } + } + } } MWBase::Environment::get().getWorld()->deleteObject(ptr); diff --git a/apps/openmw/mwmechanics/summoning.cpp b/apps/openmw/mwmechanics/summoning.cpp index facadcb1a..d90545fc6 100644 --- a/apps/openmw/mwmechanics/summoning.cpp +++ b/apps/openmw/mwmechanics/summoning.cpp @@ -155,13 +155,7 @@ namespace MWMechanics if (!ptr.isEmpty() && ptr.getClass().getCreatureStats(ptr).isDead() && ptr.getClass().getCreatureStats(ptr).isDeathAnimationFinished()) { // Purge the magic effect so a new creature can be summoned if desired - const ESM::SummonKey& key = it->first; - creatureStats.getActiveSpells().purgeEffect(key.mEffectId, key.mSourceId, key.mEffectIndex); - creatureStats.getSpells().purgeEffect(key.mEffectId, key.mSourceId); - if (mActor.getClass().hasInventoryStore(mActor)) - mActor.getClass().getInventoryStore(mActor).purgeEffect(key.mEffectId, key.mSourceId, false, key.mEffectIndex); - - MWBase::Environment::get().getMechanicsManager()->cleanupSummonedCreature(mActor, it->second); + purgeSummonEffect(mActor, *it); creatureMap.erase(it++); } else @@ -169,4 +163,14 @@ namespace MWMechanics } } + void purgeSummonEffect(const MWWorld::Ptr& summoner, const std::pair& summon) + { + auto& creatureStats = summoner.getClass().getCreatureStats(summoner); + creatureStats.getActiveSpells().purgeEffect(summon.first.mEffectId, summon.first.mSourceId, summon.first.mEffectIndex); + creatureStats.getSpells().purgeEffect(summon.first.mEffectId, summon.first.mSourceId); + if (summoner.getClass().hasInventoryStore(summoner)) + summoner.getClass().getInventoryStore(summoner).purgeEffect(summon.first.mEffectId, summon.first.mSourceId, false, summon.first.mEffectIndex); + + MWBase::Environment::get().getMechanicsManager()->cleanupSummonedCreature(summoner, summon.second); + } } diff --git a/apps/openmw/mwmechanics/summoning.hpp b/apps/openmw/mwmechanics/summoning.hpp index 7e787499e..3c3e18a96 100644 --- a/apps/openmw/mwmechanics/summoning.hpp +++ b/apps/openmw/mwmechanics/summoning.hpp @@ -17,6 +17,8 @@ namespace MWMechanics std::string getSummonedCreature(int effectId); + void purgeSummonEffect(const MWWorld::Ptr& summoner, const std::pair& summon); + struct UpdateSummonedCreatures : public EffectSourceVisitor { UpdateSummonedCreatures(const MWWorld::Ptr& actor); From 90fa8dca3535a4312794e951d6e93335f16ec2c1 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sun, 6 Jun 2021 18:10:55 +0200 Subject: [PATCH 04/13] Do not assume the bound item cache is valid after loading a save --- apps/openmw/mwmechanics/actors.cpp | 42 +++++++++++++++++------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 0ffcef2f8..218d4b420 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1239,7 +1239,7 @@ namespace MWMechanics // Update bound effects // Note: in vanilla MW multiple bound items of the same type can be created by different spells. // As these extra copies are kinda useless this may or may not be important. - static std::map boundItemsMap; + static std::map boundItemsMap; if (boundItemsMap.empty()) { boundItemsMap[ESM::MagicEffect::BoundBattleAxe] = "sMagicBoundBattleAxeID"; @@ -1255,30 +1255,36 @@ namespace MWMechanics boundItemsMap[ESM::MagicEffect::BoundSpear] = "sMagicBoundSpearID"; } - for (std::map::iterator it = boundItemsMap.begin(); it != boundItemsMap.end(); ++it) + if(ptr.getClass().hasInventoryStore(ptr)) { - bool found = creatureStats.mBoundItems.find(it->first) != creatureStats.mBoundItems.end(); - float magnitude = effects.get(it->first).getMagnitude(); - if (found != (magnitude > 0)) + for (const auto& [effect, itemGmst] : boundItemsMap) { - if (magnitude > 0) - creatureStats.mBoundItems.insert(it->first); - else - creatureStats.mBoundItems.erase(it->first); - - std::string itemGmst = it->second; - std::string item = MWBase::Environment::get().getWorld()->getStore().get().find( - itemGmst)->mValue.getString(); + bool found = creatureStats.mBoundItems.find(effect) != creatureStats.mBoundItems.end(); + float magnitude = effects.get(effect).getMagnitude(); + if (found != (magnitude > 0) || creatureStats.mBoundItems.empty()) + { + if (magnitude > 0) + creatureStats.mBoundItems.insert(effect); + else + creatureStats.mBoundItems.erase(effect); - magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr); + std::string item = MWBase::Environment::get().getWorld()->getStore().get().find( + itemGmst)->mValue.getString(); - if (it->first == ESM::MagicEffect::BoundGloves) - { - item = MWBase::Environment::get().getWorld()->getStore().get().find( - "sMagicBoundRightGauntletID")->mValue.getString(); magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr); + + if (effect == ESM::MagicEffect::BoundGloves) + { + item = MWBase::Environment::get().getWorld()->getStore().get().find( + "sMagicBoundRightGauntletID")->mValue.getString(); + magnitude > 0 ? addBoundItem(item, ptr) : removeBoundItem(item, ptr); + } } } + // mBoundItems does not get saved so the cache is out of date after loading a save. + // Use Length as a sentinel value to force an update. + if(creatureStats.mBoundItems.empty()) + creatureStats.mBoundItems.insert(ESM::MagicEffect::Length); } // Summoned creature update visitor assumes the actor belongs to a cell. From 7d0483d7ad24a72847c11330af2e9cd0ce200b21 Mon Sep 17 00:00:00 2001 From: fredzio Date: Fri, 11 Jun 2021 05:53:40 +0200 Subject: [PATCH 05/13] Cast spell even if target Ptr is empty. It happens when enchanted arrows hit water or ground. --- apps/openmw/mwmechanics/spellcasting.cpp | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 142914c35..5a367b502 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -60,10 +60,8 @@ namespace MWMechanics void CastSpell::inflict(const MWWorld::Ptr &target, const MWWorld::Ptr &caster, const ESM::EffectList &effects, ESM::RangeType range, bool reflected, bool exploded) { - if (target.isEmpty()) - return; - - if (target.getClass().isActor()) + const bool targetIsActor = !target.isEmpty() && target.getClass().isActor(); + if (targetIsActor) { // Early-out for characters that have departed. const auto& stats = target.getClass().getCreatureStats(target); @@ -85,7 +83,7 @@ namespace MWMechanics return; const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get().search (mId); - if (spell && target.getClass().isActor() && (spell->mData.mType == ESM::Spell::ST_Disease || spell->mData.mType == ESM::Spell::ST_Blight)) + if (spell && targetIsActor && (spell->mData.mType == ESM::Spell::ST_Disease || spell->mData.mType == ESM::Spell::ST_Blight)) { int requiredResistance = (spell->mData.mType == ESM::Spell::ST_Disease) ? ESM::MagicEffect::ResistCommonDisease @@ -108,13 +106,13 @@ namespace MWMechanics // This is required for Weakness effects in a spell to apply to any subsequent effects in the spell. // Otherwise, they'd only apply after the whole spell was added. MagicEffects targetEffects; - if (target.getClass().isActor()) + if (targetIsActor) targetEffects += target.getClass().getCreatureStats(target).getMagicEffects(); bool castByPlayer = (!caster.isEmpty() && caster == getPlayer()); ActiveSpells targetSpells; - if (target.getClass().isActor()) + if (targetIsActor) targetSpells = target.getClass().getCreatureStats(target).getActiveSpells(); bool canCastAnEffect = false; // For bound equipment.If this remains false @@ -126,7 +124,7 @@ namespace MWMechanics int currentEffectIndex = 0; for (std::vector::const_iterator effectIt (effects.mList.begin()); - effectIt != effects.mList.end(); ++effectIt, ++currentEffectIndex) + !target.isEmpty() && effectIt != effects.mList.end(); ++effectIt, ++currentEffectIndex) { if (effectIt->mRange != range) continue; @@ -270,7 +268,7 @@ namespace MWMechanics } // Re-casting a summon effect will remove the creature from previous castings of that effect. - if (isSummoningEffect(effectIt->mEffectID) && target.getClass().isActor()) + if (isSummoningEffect(effectIt->mEffectID) && targetIsActor) { CreatureStats& targetStats = target.getClass().getCreatureStats(target); ESM::SummonKey key(effectIt->mEffectID, mId, currentEffectIndex); @@ -313,16 +311,19 @@ namespace MWMechanics if (!exploded) MWBase::Environment::get().getWorld()->explodeSpell(mHitPosition, effects, caster, target, range, mId, mSourceName, mFromProjectile); - if (!reflectedEffects.mList.empty()) - inflict(caster, target, reflectedEffects, range, true, exploded); - - if (!appliedLastingEffects.empty()) + if (!target.isEmpty()) { - int casterActorId = -1; - if (!caster.isEmpty() && caster.getClass().isActor()) - casterActorId = caster.getClass().getCreatureStats(caster).getActorId(); - target.getClass().getCreatureStats(target).getActiveSpells().addSpell(mId, mStack, appliedLastingEffects, - mSourceName, casterActorId); + if (!reflectedEffects.mList.empty()) + inflict(caster, target, reflectedEffects, range, true, exploded); + + if (!appliedLastingEffects.empty()) + { + int casterActorId = -1; + if (!caster.isEmpty() && caster.getClass().isActor()) + casterActorId = caster.getClass().getCreatureStats(caster).getActorId(); + target.getClass().getCreatureStats(target).getActiveSpells().addSpell(mId, mStack, appliedLastingEffects, + mSourceName, casterActorId); + } } } From 49ce26361efac9bb0557e62a184f8b0f9f655dd1 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 11 Jun 2021 16:44:15 +0200 Subject: [PATCH 06/13] update mac deps to include latest OSGoS 3.6, mygui 3.4.1 and multi-threaded bullet --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index ec19c7321..1936076cc 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -15,7 +15,7 @@ ccache --version cmake --version qmake --version -curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-8f5ef6e.zip -o ~/openmw-deps.zip +curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-20210611.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null # additional libraries From 91e1898aa209d87a66a11787035491cc528d8a3a Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Fri, 11 Jun 2021 20:27:17 +0200 Subject: [PATCH 07/13] make use of gitlab openmw-deps --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 1936076cc..a6fdbd8c8 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -15,7 +15,7 @@ ccache --version cmake --version qmake --version -curl -fSL -R -J https://downloads.openmw.org/osx/dependencies/openmw-deps-20210611.zip -o ~/openmw-deps.zip +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20210611.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null # additional libraries From 868a5b35e3912245dd28669dbb96800879664991 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 12 Jun 2021 00:10:55 +0200 Subject: [PATCH 08/13] workaround shadow issue on macOS, https://gitlab.com/OpenMW/openmw/-/issues/6057 --- components/sceneutil/mwshadowtechnique.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index e9eb9b2b2..88d44d2f6 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -566,8 +566,9 @@ MWShadowTechnique::ShadowData::ShadowData(MWShadowTechnique::ViewDependentData* _camera = new osg::Camera; _camera->setName("ShadowCamera"); _camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT); +#ifndef __APPLE__ // workaround shadow issue on macOS, https://gitlab.com/OpenMW/openmw/-/issues/6057 _camera->setImplicitBufferAttachmentMask(0, 0); - +#endif //_camera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); _camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f)); From f92fbc2acd1c8508c8941b173345e6c3c0c6c3a7 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Sat, 12 Jun 2021 00:10:55 +0200 Subject: [PATCH 09/13] workaround shadow issue on macOS, https://gitlab.com/OpenMW/openmw/-/issues/6057 --- components/sceneutil/mwshadowtechnique.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/sceneutil/mwshadowtechnique.cpp b/components/sceneutil/mwshadowtechnique.cpp index e9eb9b2b2..88d44d2f6 100644 --- a/components/sceneutil/mwshadowtechnique.cpp +++ b/components/sceneutil/mwshadowtechnique.cpp @@ -566,8 +566,9 @@ MWShadowTechnique::ShadowData::ShadowData(MWShadowTechnique::ViewDependentData* _camera = new osg::Camera; _camera->setName("ShadowCamera"); _camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT); +#ifndef __APPLE__ // workaround shadow issue on macOS, https://gitlab.com/OpenMW/openmw/-/issues/6057 _camera->setImplicitBufferAttachmentMask(0, 0); - +#endif //_camera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); _camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f)); From 7fa67ff675e944e80dde261a62e6b8fccf8ba79e Mon Sep 17 00:00:00 2001 From: CedricMocquillon Date: Sat, 12 Jun 2021 15:33:53 +0200 Subject: [PATCH 10/13] Use same distance for all lod instances of a chunk --- apps/openmw/mwrender/objectpaging.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index b6bae8cbb..8e29f0af4 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -477,6 +477,8 @@ namespace MWRender constexpr auto copyMask = ~Mask_UpdateVisitor; AnalyzeVisitor analyzeVisitor(copyMask); + osg::Vec3f center3 = { center.x(), center.y(), 0.f }; + analyzeVisitor.mCurrentDistance = (viewPoint - center3).length2(); float minSize = mMinSize; if (mMinSizeMergeFactor) minSize *= mMinSizeMergeFactor; @@ -546,7 +548,6 @@ namespace MWRender continue; } - analyzeVisitor.mCurrentDistance = dSqr; auto emplaced = nodes.emplace(cnode, InstanceList()); if (emplaced.second) { From 7d756d997e94a86f10442e35eae8e88d9bff34ed Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Jun 2021 18:18:52 +0200 Subject: [PATCH 11/13] Rebuild the cache in readState --- apps/openmw/mwmechanics/actors.cpp | 6 +----- apps/openmw/mwmechanics/creaturestats.cpp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index 218d4b420..87f462d6f 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -1261,7 +1261,7 @@ namespace MWMechanics { bool found = creatureStats.mBoundItems.find(effect) != creatureStats.mBoundItems.end(); float magnitude = effects.get(effect).getMagnitude(); - if (found != (magnitude > 0) || creatureStats.mBoundItems.empty()) + if (found != (magnitude > 0)) { if (magnitude > 0) creatureStats.mBoundItems.insert(effect); @@ -1281,10 +1281,6 @@ namespace MWMechanics } } } - // mBoundItems does not get saved so the cache is out of date after loading a save. - // Use Length as a sentinel value to force an update. - if(creatureStats.mBoundItems.empty()) - creatureStats.mBoundItems.insert(ESM::MagicEffect::Length); } // Summoned creature update visitor assumes the actor belongs to a cell. diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 4bc0b9a58..c6561af96 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -601,6 +601,28 @@ namespace MWMechanics mAiSequence.readState(state.mAiSequence); mMagicEffects.readState(state.mMagicEffects); + // Rebuild the bound item cache + for(int effectId = ESM::MagicEffect::BoundDagger; effectId <= ESM::MagicEffect::BoundGloves; effectId++) + { + if(mMagicEffects.get(effectId).getMagnitude() > 0) + mBoundItems.insert(effectId); + else + { + // Check active spell effects + // We can't use mActiveSpells::getMagicEffects here because it doesn't include expired effects + auto spell = std::find_if(mActiveSpells.begin(), mActiveSpells.end(), [&] (const auto& spell) + { + const auto& effects = spell.second.mEffects; + return std::find_if(effects.begin(), effects.end(), [&] (const auto& effect) + { + return effect.mEffectId == effectId; + }) != effects.end(); + }); + if(spell != mActiveSpells.end()) + mBoundItems.insert(effectId); + } + } + mSummonedCreatures = state.mSummonedCreatureMap; mSummonGraveyard = state.mSummonGraveyard; From dd197765c8349c5ba6cfafd24cc0196473bc5ab1 Mon Sep 17 00:00:00 2001 From: psi29a Date: Wed, 16 Jun 2021 08:28:48 +0000 Subject: [PATCH 12/13] cmake check to enforce that if someone uses OSG 3.6, that it is at least 3.6.5 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e1f0a01c..ee7e29bd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,7 +355,11 @@ if(NOT HAVE_STDINT_H) endif() if(OPENMW_USE_SYSTEM_OSG) - find_package(OpenSceneGraph 3.3.4 REQUIRED ${USED_OSG_COMPONENTS}) + find_package(OpenSceneGraph 3.4.0 REQUIRED ${USED_OSG_COMPONENTS}) + if (${OPENSCENEGRAPH_VERSION} VERSION_GREATER 3.6.2 AND ${OPENSCENEGRAPH_VERSION} VERSION_LESS 3.6.5) + message(FATAL_ERROR "OpenSceneGraph version ${OPENSCENEGRAPH_VERSION} has critical regressions which cause crashes. Please upgrade to 3.6.5 or later. We strongly recommend using the tip of the official 'OpenSceneGraph-3.6' branch or the tip of '3.6' OpenMW/osg (OSGoS).") + endif() + if(OSG_STATIC) find_package(OSGPlugins REQUIRED COMPONENTS ${USED_OSG_PLUGINS}) endif() From 7be09078b4342dffd4bba47f3ef9cad413eafba3 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Thu, 17 Jun 2021 01:12:31 +0200 Subject: [PATCH 13/13] bump mac deps to include collada --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index a6fdbd8c8..1ca0fc611 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -15,7 +15,7 @@ ccache --version cmake --version qmake --version -curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20210611.zip -o ~/openmw-deps.zip +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20210617.zip -o ~/openmw-deps.zip unzip -o ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null # additional libraries