diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index d5af28964..dcba11c17 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -117,14 +117,6 @@ namespace MWDialogue if(!selectCompare(comp,0,select.mI)) return false; break; - case 40://PC Common Disease - if(!selectCompare(comp,0,select.mI)) return false; - break; - - case 41://PC Blight Disease - if(!selectCompare(comp,0,select.mI)) return false; - break; - case 43://PC Crime level if(!selectCompare(comp,0,select.mI)) return false; break; diff --git a/apps/openmw/mwdialogue/filter.cpp b/apps/openmw/mwdialogue/filter.cpp index 59027617f..5a1ec2d84 100644 --- a/apps/openmw/mwdialogue/filter.cpp +++ b/apps/openmw/mwdialogue/filter.cpp @@ -11,6 +11,8 @@ #include "../mwworld/containerstore.hpp" #include "../mwmechanics/npcstats.hpp" +#include "../mwmechanics/creaturestats.hpp" +#include "../mwmechanics/magiceffects.hpp" #include "selectwrapper.hpp" @@ -232,6 +234,8 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) const { + MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); + switch (select.getFunction()) { case SelectWrapper::Function_Id: @@ -255,12 +259,22 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co return toLower (mActor.getCell()->mCell->mName)==select.getName(); case SelectWrapper::Function_SameFaction: - { - MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); - + return MWWorld::Class::get (mActor).getNpcStats (mActor).isSameFaction ( MWWorld::Class::get (player).getNpcStats (player)); - } + + case SelectWrapper::Function_PcCommonDisease: + + return MWWorld::Class::get (player).getCreatureStats (player).hasCommonDisease(); + + case SelectWrapper::Function_PcBlightDisease: + + return MWWorld::Class::get (player).getCreatureStats (player).hasBlightDisease(); + + case SelectWrapper::Function_PcCorprus: + + return MWWorld::Class::get (player).getCreatureStats (player). + getMagicEffects().get (132).mMagnitude!=0; default: diff --git a/apps/openmw/mwdialogue/selectwrapper.cpp b/apps/openmw/mwdialogue/selectwrapper.cpp index bfd7f8cf8..d49d73a8d 100644 --- a/apps/openmw/mwdialogue/selectwrapper.cpp +++ b/apps/openmw/mwdialogue/selectwrapper.cpp @@ -61,8 +61,11 @@ MWDialogue::SelectWrapper::Function MWDialogue::SelectWrapper::decodeFunction() switch (index) { + case 40: return Function_PcCommonDisease; + case 41: return Function_PcBlightDisease; case 46: return Function_SameFaction; case 50: return Function_Choice; + case 58: return Function_PcCorprus; } return Function_None; @@ -112,6 +115,7 @@ MWDialogue::SelectWrapper::Type MWDialogue::SelectWrapper::getType() const { Function_Id, Function_Faction, Function_Class, Function_Race, Function_Cell, Function_SameFaction, + Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus, Function_None // end marker }; diff --git a/apps/openmw/mwdialogue/selectwrapper.hpp b/apps/openmw/mwdialogue/selectwrapper.hpp index 4f105aa5a..d0e2dbb6a 100644 --- a/apps/openmw/mwdialogue/selectwrapper.hpp +++ b/apps/openmw/mwdialogue/selectwrapper.hpp @@ -25,7 +25,8 @@ namespace MWDialogue Function_Local, Function_Global, Function_SameFaction, - Function_Choice + Function_Choice, + Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus }; enum Type