1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwworld/actionopen.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
870 B
C++
Raw Normal View History

2012-04-15 17:52:39 +02:00
#include "actionopen.hpp"
2012-05-11 11:52:07 +02:00
#include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/actorutil.hpp"
#include "../mwmechanics/disease.hpp"
2012-04-15 17:52:39 +02:00
namespace MWWorld
{
ActionOpen::ActionOpen(const MWWorld::Ptr& container)
: Action(false, container)
{
2012-04-15 17:52:39 +02:00
}
void ActionOpen::executeImp(const MWWorld::Ptr& actor)
2012-04-15 17:52:39 +02:00
{
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return;
if (actor != MWMechanics::getPlayer())
return;
if (!MWBase::Environment::get().getMechanicsManager()->onOpen(getTarget()))
return;
MWMechanics::diseaseContact(actor, getTarget());
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container, getTarget());
2012-04-15 17:52:39 +02:00
}
}