1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-01 15:09:43 +00:00

Merge branch 'master' of gitlab.com:OpenMW/openmw into freeunrealestate

This commit is contained in:
Evil Eye 2021-02-07 00:17:14 +01:00
commit e4cd89643f
9 changed files with 22 additions and 19 deletions

View file

@ -215,6 +215,7 @@ Programmers
Yohaulticetl Yohaulticetl
Yuri Krupenin Yuri Krupenin
zelurker zelurker
Noah Gooder
Documentation Documentation
------------- -------------

View file

@ -98,6 +98,8 @@
Bug #5758: Paralyzed actors behavior is inconsistent with vanilla Bug #5758: Paralyzed actors behavior is inconsistent with vanilla
Bug #5762: Movement solver is insufficiently robust Bug #5762: Movement solver is insufficiently robust
Bug #5821: NPCs from mods getting removed if mod order was changed Bug #5821: NPCs from mods getting removed if mod order was changed
Bug #5835: OpenMW doesn't accept negative values for NPC's hello, alarm, fight, and flee
Bug #5836: OpenMW dialogue/greeting/voice filter doesn't accept negative Ai values for NPC's hello, alarm, fight, and flee
Bug #5841: Can't Cast Zero Cost Spells When Magicka is < 0 Bug #5841: Can't Cast Zero Cost Spells When Magicka is < 0
Feature #390: 3rd person look "over the shoulder" Feature #390: 3rd person look "over the shoulder"
Feature #1536: Show more information about level on menu Feature #1536: Show more information about level on menu

View file

@ -316,7 +316,7 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
case SelectWrapper::Function_AiSetting: case SelectWrapper::Function_AiSetting:
return mActor.getClass().getCreatureStats (mActor).getAiSetting ( return mActor.getClass().getCreatureStats (mActor).getAiSetting (
(MWMechanics::CreatureStats::AiSetting)select.getArgument()).getModified(); (MWMechanics::CreatureStats::AiSetting)select.getArgument()).getModified(false);
case SelectWrapper::Function_PcAttribute: case SelectWrapper::Function_PcAttribute:

View file

@ -951,29 +951,29 @@ namespace MWMechanics
if (actor.getClass().hasInventoryStore(actor)) if (actor.getClass().hasInventoryStore(actor))
actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Poison); actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Poison);
} }
else if (effects.get(ESM::MagicEffect::CureParalyzation).getModifier() > 0) if (effects.get(ESM::MagicEffect::CureParalyzation).getModifier() > 0)
{ {
creatureStats.getActiveSpells().purgeEffect(ESM::MagicEffect::Paralyze); creatureStats.getActiveSpells().purgeEffect(ESM::MagicEffect::Paralyze);
creatureStats.getSpells().purgeEffect(ESM::MagicEffect::Paralyze); creatureStats.getSpells().purgeEffect(ESM::MagicEffect::Paralyze);
if (actor.getClass().hasInventoryStore(actor)) if (actor.getClass().hasInventoryStore(actor))
actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Paralyze); actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Paralyze);
} }
else if (effects.get(ESM::MagicEffect::CureCommonDisease).getModifier() > 0) if (effects.get(ESM::MagicEffect::CureCommonDisease).getModifier() > 0)
{ {
creatureStats.getSpells().purgeCommonDisease(); creatureStats.getSpells().purgeCommonDisease();
} }
else if (effects.get(ESM::MagicEffect::CureBlightDisease).getModifier() > 0) if (effects.get(ESM::MagicEffect::CureBlightDisease).getModifier() > 0)
{ {
creatureStats.getSpells().purgeBlightDisease(); creatureStats.getSpells().purgeBlightDisease();
} }
else if (effects.get(ESM::MagicEffect::CureCorprusDisease).getModifier() > 0) if (effects.get(ESM::MagicEffect::CureCorprusDisease).getModifier() > 0)
{ {
creatureStats.getActiveSpells().purgeCorprusDisease(); creatureStats.getActiveSpells().purgeCorprusDisease();
creatureStats.getSpells().purgeCorprusDisease(); creatureStats.getSpells().purgeCorprusDisease();
if (actor.getClass().hasInventoryStore(actor)) if (actor.getClass().hasInventoryStore(actor))
actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Corprus, true); actor.getClass().getInventoryStore(actor).purgeEffect(ESM::MagicEffect::Corprus, true);
} }
else if (effects.get(ESM::MagicEffect::RemoveCurse).getModifier() > 0) if (effects.get(ESM::MagicEffect::RemoveCurse).getModifier() > 0)
{ {
creatureStats.getSpells().purgeCurses(); creatureStats.getSpells().purgeCurses();
} }

View file

@ -18,8 +18,10 @@ namespace MWMechanics
} }
template<typename T> template<typename T>
T Stat<T>::getModified() const T Stat<T>::getModified(bool capped) const
{ {
if(!capped)
return mModified;
return std::max(static_cast<T>(0), mModified); return std::max(static_cast<T>(0), mModified);
} }

View file

@ -28,7 +28,7 @@ namespace MWMechanics
const T& getBase() const; const T& getBase() const;
T getModified() const; T getModified(bool capped = true) const;
T getCurrentModified() const; T getCurrentModified() const;
T getModifier() const; T getModifier() const;
T getCurrentModifier() const; T getCurrentModifier() const;

View file

@ -241,7 +241,7 @@ namespace MWScript
{ {
MWWorld::Ptr ptr = R()(runtime); MWWorld::Ptr ptr = R()(runtime);
runtime.push(ptr.getClass().getCreatureStats (ptr).getAiSetting (mIndex).getModified()); runtime.push(ptr.getClass().getCreatureStats (ptr).getAiSetting (mIndex).getModified(false));
} }
}; };
template<class R> template<class R>
@ -276,9 +276,7 @@ namespace MWScript
Interpreter::Type_Integer value = runtime[0].mInteger; Interpreter::Type_Integer value = runtime[0].mInteger;
runtime.pop(); runtime.pop();
MWMechanics::Stat<int> stat = ptr.getClass().getCreatureStats(ptr).getAiSetting(mIndex); ptr.getClass().getCreatureStats(ptr).setAiSetting(mIndex, value);
stat.setModified(value, 0);
ptr.getClass().getCreatureStats(ptr).setAiSetting(mIndex, stat);
ptr.getClass().setBaseAISetting(ptr.getCellRef().getRefId(), mIndex, value); ptr.getClass().setBaseAISetting(ptr.getCellRef().getRefId(), mIndex, value);
} }
}; };

View file

@ -997,9 +997,9 @@ void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
} }
// 1. Traverse main scene graph // 1. Traverse main scene graph
cv.pushStateSet( _shadowRecievingPlaceholderStateSet.get() ); auto* shadowReceiverStateSet = vdd->getStateSet(cv.getTraversalNumber());
shadowReceiverStateSet->clear();
osg::ref_ptr<osgUtil::StateGraph> decoratorStateGraph = cv.getCurrentStateGraph(); cv.pushStateSet(shadowReceiverStateSet);
cullShadowReceivingScene(&cv); cullShadowReceivingScene(&cv);
@ -1426,7 +1426,7 @@ void MWShadowTechnique::cull(osgUtil::CullVisitor& cv)
if (numValidShadows>0) if (numValidShadows>0)
{ {
decoratorStateGraph->setStateSet(selectStateSetForRenderingShadow(*vdd, cv.getTraversalNumber())); prepareStateSetForRenderingShadow(*vdd, cv.getTraversalNumber());
} }
// OSG_NOTICE<<"End of shadow setup Projection matrix "<<*cv.getProjectionMatrix()<<std::endl; // OSG_NOTICE<<"End of shadow setup Projection matrix "<<*cv.getProjectionMatrix()<<std::endl;
@ -3004,9 +3004,9 @@ void MWShadowTechnique::cullShadowCastingScene(osgUtil::CullVisitor* cv, osg::Ca
return; return;
} }
osg::StateSet* MWShadowTechnique::selectStateSetForRenderingShadow(ViewDependentData& vdd, unsigned int traversalNumber) const osg::StateSet* MWShadowTechnique::prepareStateSetForRenderingShadow(ViewDependentData& vdd, unsigned int traversalNumber) const
{ {
OSG_INFO<<" selectStateSetForRenderingShadow() "<<vdd.getStateSet(traversalNumber)<<std::endl; OSG_INFO<<" prepareStateSetForRenderingShadow() "<<vdd.getStateSet(traversalNumber)<<std::endl;
osg::ref_ptr<osg::StateSet> stateset = vdd.getStateSet(traversalNumber); osg::ref_ptr<osg::StateSet> stateset = vdd.getStateSet(traversalNumber);

View file

@ -231,7 +231,7 @@ namespace SceneUtil {
virtual void cullShadowCastingScene(osgUtil::CullVisitor* cv, osg::Camera* camera) const; virtual void cullShadowCastingScene(osgUtil::CullVisitor* cv, osg::Camera* camera) const;
virtual osg::StateSet* selectStateSetForRenderingShadow(ViewDependentData& vdd, unsigned int traversalNumber) const; virtual osg::StateSet* prepareStateSetForRenderingShadow(ViewDependentData& vdd, unsigned int traversalNumber) const;
protected: protected:
virtual ~MWShadowTechnique(); virtual ~MWShadowTechnique();