mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 18:09:43 +00:00
Make StartCombat a no-op for dead targets and don't play an attack line when already in combat
This commit is contained in:
parent
76ad680549
commit
4dfe6078c8
3 changed files with 5 additions and 2 deletions
|
@ -131,6 +131,7 @@
|
|||
Bug #7758: Water walking is not taken into account to compute path cost on the water
|
||||
Bug #7761: Rain and ambient loop sounds are mutually exclusive
|
||||
Bug #7765: OpenMW-CS: Touch Record option is broken
|
||||
Bug #7769: Sword of the Perithia: Broken NPCs
|
||||
Bug #7770: Sword of the Perithia: Script execution failure
|
||||
Bug #7780: Non-ASCII texture paths in NIF files don't work
|
||||
Feature #2566: Handle NAM9 records for manual cell references
|
||||
|
|
|
@ -1681,6 +1681,7 @@ namespace MWMechanics
|
|||
return;
|
||||
}
|
||||
|
||||
const bool inCombat = stats.getAiSequence().isInCombat();
|
||||
stats.getAiSequence().stack(MWMechanics::AiCombat(target), ptr);
|
||||
if (target == getPlayer())
|
||||
{
|
||||
|
@ -1715,6 +1716,7 @@ namespace MWMechanics
|
|||
}
|
||||
|
||||
// Must be done after the target is set up, so that CreatureTargetted dialogue filter works properly
|
||||
if (!inCombat)
|
||||
MWBase::Environment::get().getDialogueManager()->say(ptr, ESM::RefId::stringRefId("attack"));
|
||||
}
|
||||
|
||||
|
|
|
@ -507,7 +507,7 @@ namespace MWScript
|
|||
runtime.pop();
|
||||
|
||||
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->searchPtr(targetID, true, false);
|
||||
if (!target.isEmpty())
|
||||
if (!target.isEmpty() && !target.getClass().getCreatureStats(target).isDead())
|
||||
MWBase::Environment::get().getMechanicsManager()->startCombat(actor, target);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue