1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Werewolf: only NPCs should have modified fight and react to your transformation

This commit is contained in:
MiroslavR 2014-09-06 03:09:11 +02:00
parent 9e0d5dc28a
commit c1cc66985d
2 changed files with 11 additions and 5 deletions

View File

@ -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<ESM::GameSetting>().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<ESM::GameSetting>().search("iWerewolfFightMod");
fight += iWerewolfFightMod->getInt();
}
}
return (fight >= 100);

View File

@ -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;