mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 22:15:32 +00:00
Fix a bug where the player's inventory could be opened as a container
If an NPC uses AiActivate on the player (i.e. to activate dialogue) precisely in the frame where the player just died, the player's inventory would be opened as a container instead.
This commit is contained in:
parent
21142711f0
commit
312dc84fa4
1 changed files with 4 additions and 4 deletions
|
@ -797,6 +797,10 @@ namespace MWClass
|
||||||
boost::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr,
|
boost::shared_ptr<MWWorld::Action> Npc::activate (const MWWorld::Ptr& ptr,
|
||||||
const MWWorld::Ptr& actor) const
|
const MWWorld::Ptr& actor) const
|
||||||
{
|
{
|
||||||
|
// player got activated by another NPC
|
||||||
|
if(ptr.getRefData().getHandle() == "player")
|
||||||
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor));
|
||||||
|
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
@ -814,10 +818,6 @@ namespace MWClass
|
||||||
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak))
|
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak))
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
||||||
|
|
||||||
// player got activated by another NPC
|
|
||||||
if(ptr.getRefData().getHandle() == "player")
|
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor));
|
|
||||||
|
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(ptr));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue