|
|
@ -884,24 +884,24 @@ namespace MWClass
|
|
|
|
// otherwise wait until death animation
|
|
|
|
// otherwise wait until death animation
|
|
|
|
if(stats.isDeathAnimationFinished())
|
|
|
|
if(stats.isDeathAnimationFinished())
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr));
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr));
|
|
|
|
|
|
|
|
|
|
|
|
// death animation is not finished, do nothing
|
|
|
|
|
|
|
|
return std::shared_ptr<MWWorld::Action> (new MWWorld::FailedAction(""));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!stats.getAiSequence().isInCombat())
|
|
|
|
if(stats.getAiSequence().isInCombat())
|
|
|
|
{
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction(""));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak) || stats.getKnockedDown())
|
|
|
|
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak) || stats.getKnockedDown())
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
|
|
|
|
|
|
|
|
|
|
|
// Can't talk to werewolfs
|
|
|
|
// Can't talk to werewolves
|
|
|
|
if(getNpcStats(ptr).isWerewolf())
|
|
|
|
if (!getNpcStats(ptr).isWerewolf())
|
|
|
|
return std::shared_ptr<MWWorld::Action> (new MWWorld::FailedAction(""));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Tribunal and some mod companions oddly enough must use open action as fallback
|
|
|
|
|
|
|
|
if (!getScript(ptr).empty() && ptr.getRefData().getLocals().getIntVar(getScript(ptr), "companion"))
|
|
|
|
|
|
|
|
return std::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return std::shared_ptr<MWWorld::Action> (new MWWorld::FailedAction(""));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr)
|
|
|
|
MWWorld::ContainerStore& Npc::getContainerStore (const MWWorld::Ptr& ptr)
|
|
|
|
const
|
|
|
|
const
|
|
|
|
{
|
|
|
|
{
|
|
|
|