Make StartCombat a no-op for dead targets and don't play an attack line when already in combat

ini_importer_tests
Evil Eye 4 months ago
parent 76ad680549
commit 4dfe6078c8

@ -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,7 +1716,8 @@ namespace MWMechanics
}
// Must be done after the target is set up, so that CreatureTargetted dialogue filter works properly
MWBase::Environment::get().getDialogueManager()->say(ptr, ESM::RefId::stringRefId("attack"));
if (!inCombat)
MWBase::Environment::get().getDialogueManager()->say(ptr, ESM::RefId::stringRefId("attack"));
}
void MechanicsManager::stopCombat(const MWWorld::Ptr& actor)

@ -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…
Cancel
Save