From c1cc66985dba67cad7dc7ec1004c28bd53311b0e Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Sat, 6 Sep 2014 03:09:11 +0200 Subject: [PATCH] Werewolf: only NPCs should have modified fight and react to your transformation --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 13 ++++++++----- apps/openmw/mwworld/worldimp.cpp | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index cb6e025dbc..b21c0f6746 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -1307,12 +1307,15 @@ namespace MWMechanics + ((50 - disposition) * fFightDispMult)) + bias; - if (target.getClass().getNpcStats(target).isWerewolf() || - (target == MWBase::Environment::get().getWorld()->getPlayerPtr() && - MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf"))) + if (ptr.getClass().isNpc() && target.getClass().isNpc()) { - const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get().search("iWerewolfFightMod"); - fight += iWerewolfFightMod->getInt(); + if (target.getClass().getNpcStats(target).isWerewolf() || + (target == MWBase::Environment::get().getWorld()->getPlayerPtr() && + MWBase::Environment::get().getWorld()->getGlobalInt("pcknownwerewolf"))) + { + const ESM::GameSetting * iWerewolfFightMod = MWBase::Environment::get().getWorld()->getStore().get().search("iWerewolfFightMod"); + fight += iWerewolfFightMod->getInt(); + } } return (fight >= 100); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index bb76f2be95..44dc69ee8d 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2344,6 +2344,9 @@ namespace MWWorld if (*it == actor) continue; + if (!it->getClass().isNpc()) + continue; + if (getLOS(*it, actor) && MWBase::Environment::get().getMechanicsManager()->awarenessCheck(actor, *it)) { detected = true;