1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Fix ShouldAttack filter

This makes NPCs exit dialogue properly when they should attack as a result of taunting actions.
This commit is contained in:
scrawl 2014-05-22 12:14:33 +02:00
parent c6c254d279
commit 3380e1e1c5
2 changed files with 1 additions and 3 deletions

View File

@ -539,7 +539,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
case SelectWrapper::Function_ShouldAttack:
return MWWorld::Class::get (mActor).getCreatureStats (mActor).isHostile();
return mActor.getClass().getCreatureStats(mActor).getAiSetting(MWMechanics::CreatureStats::AI_Fight).getModified() >= 80;
case SelectWrapper::Function_CreatureTargetted:

View File

@ -666,8 +666,6 @@ namespace MWMechanics
int fight = npcStats.getAiSetting(MWMechanics::CreatureStats::AI_Fight).getBase();
npcStats.setAiSetting (MWMechanics::CreatureStats::AI_Flee,
std::max(0, std::min(100, flee + int(std::max(iPerMinChange, s)))));
// TODO: initiate combat and quit dialogue if fight rating is too high
// or should setAiSetting handle this?
npcStats.setAiSetting (MWMechanics::CreatureStats::AI_Fight,
std::max(0, std::min(100, fight + int(std::min(-iPerMinChange, -s)))));
}