mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-11 00:44:33 +00:00
Don't set Attacked flag when the actor is already in combat with the attacker (Fixes #1909)
This commit is contained in:
parent
c5fa0768f1
commit
1270dada34
@ -329,7 +329,8 @@ namespace MWClass
|
|||||||
{
|
{
|
||||||
// NOTE: 'object' and/or 'attacker' may be empty.
|
// NOTE: 'object' and/or 'attacker' may be empty.
|
||||||
|
|
||||||
getCreatureStats(ptr).setAttacked(true);
|
if (!attacker.isEmpty() && !ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat(attacker))
|
||||||
|
getCreatureStats(ptr).setAttacked(true);
|
||||||
|
|
||||||
// Self defense
|
// Self defense
|
||||||
if ((canWalk(ptr) || canFly(ptr) || canSwim(ptr)) // No retaliation for totally static creatures
|
if ((canWalk(ptr) || canFly(ptr) || canSwim(ptr)) // No retaliation for totally static creatures
|
||||||
|
@ -640,10 +640,12 @@ namespace MWClass
|
|||||||
|
|
||||||
bool wasDead = getCreatureStats(ptr).isDead();
|
bool wasDead = getCreatureStats(ptr).isDead();
|
||||||
|
|
||||||
getCreatureStats(ptr).setAttacked(true);
|
if (!attacker.isEmpty() && !ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat(attacker))
|
||||||
|
{
|
||||||
|
getCreatureStats(ptr).setAttacked(true);
|
||||||
|
|
||||||
if (!attacker.isEmpty())
|
|
||||||
MWBase::Environment::get().getMechanicsManager()->actorAttacked(ptr, attacker);
|
MWBase::Environment::get().getMechanicsManager()->actorAttacked(ptr, attacker);
|
||||||
|
}
|
||||||
|
|
||||||
if(!successful)
|
if(!successful)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user