mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
parent
46dc290b75
commit
82982bbc05
3 changed files with 31 additions and 17 deletions
|
@ -105,6 +105,8 @@
|
|||
Bug #7679: Scene luminance value flashes when toggling shaders
|
||||
Bug #7685: Corky sometimes doesn't follow Llovyn Andus
|
||||
Bug #7712: Casting doesn't support spells and enchantments with no effects
|
||||
Bug #7723: Assaulting vampires and werewolves shouldn't be a crime
|
||||
Bug #7724: Guards don't help vs werewolves
|
||||
Feature #3537: Shader-based water ripples
|
||||
Feature #5173: Support for NiFogProperty
|
||||
Feature #5492: Let rain and snow collide with statics
|
||||
|
|
|
@ -707,10 +707,9 @@ namespace MWMechanics
|
|||
}
|
||||
}
|
||||
|
||||
// Make guards go aggressive with creatures that are in combat, unless the creature is a follower or escorter
|
||||
// Make guards go aggressive with creatures and werewolves that are in combat
|
||||
const auto world = MWBase::Environment::get().getWorld();
|
||||
if (!aggressive && actor1.getClass().isClass(actor1, "Guard") && !actor2.getClass().isNpc()
|
||||
&& creatureStats2.getAiSequence().isInCombat())
|
||||
if (!aggressive && actor1.getClass().isClass(actor1, "Guard") && creatureStats2.getAiSequence().isInCombat())
|
||||
{
|
||||
// Check if the creature is too far
|
||||
static const float fAlarmRadius
|
||||
|
@ -718,7 +717,13 @@ namespace MWMechanics
|
|||
if (sqrDist > fAlarmRadius * fAlarmRadius)
|
||||
return;
|
||||
|
||||
bool targetIsCreature = !actor2.getClass().isNpc();
|
||||
if (targetIsCreature || actor2.getClass().getNpcStats(actor2).isWerewolf())
|
||||
{
|
||||
bool followerOrEscorter = false;
|
||||
// ...unless the creature has allies
|
||||
if (targetIsCreature)
|
||||
{
|
||||
for (const auto& package : creatureStats2.getAiSequence())
|
||||
{
|
||||
// The follow package must be first or have nothing but combat before it
|
||||
|
@ -730,9 +735,13 @@ namespace MWMechanics
|
|||
else if (package->getTypeId() != MWMechanics::AiPackageTypeId::Combat)
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Morrowind also checks "known werewolf" flag, but the player is never in combat
|
||||
// so this code is unreachable for the player
|
||||
if (!followerOrEscorter)
|
||||
aggressive = true;
|
||||
}
|
||||
}
|
||||
|
||||
// If any of the above conditions turned actor1 aggressive towards actor2, do an awareness check. If it passes,
|
||||
// start combat with actor2.
|
||||
|
|
|
@ -1466,10 +1466,13 @@ namespace MWMechanics
|
|||
|
||||
bool MechanicsManager::canCommitCrimeAgainst(const MWWorld::Ptr& target, const MWWorld::Ptr& attacker)
|
||||
{
|
||||
const MWMechanics::AiSequence& seq = target.getClass().getCreatureStats(target).getAiSequence();
|
||||
return target.getClass().isNpc() && !attacker.isEmpty() && !seq.isInCombat(attacker)
|
||||
&& !isAggressive(target, attacker) && !seq.isEngagedWithActor()
|
||||
&& !target.getClass().getCreatureStats(target).getAiSequence().isInPursuit();
|
||||
const MWWorld::Class& cls = target.getClass();
|
||||
const MWMechanics::CreatureStats& stats = cls.getCreatureStats(target);
|
||||
const MWMechanics::AiSequence& seq = stats.getAiSequence();
|
||||
return cls.isNpc() && !attacker.isEmpty() && !seq.isInCombat(attacker) && !isAggressive(target, attacker)
|
||||
&& !seq.isEngagedWithActor() && !stats.getAiSequence().isInPursuit()
|
||||
&& !cls.getNpcStats(target).isWerewolf()
|
||||
&& stats.getMagicEffects().getOrDefault(ESM::MagicEffect::Vampirism).getMagnitude() <= 0;
|
||||
}
|
||||
|
||||
void MechanicsManager::actorKilled(const MWWorld::Ptr& victim, const MWWorld::Ptr& attacker)
|
||||
|
|
Loading…
Reference in a new issue