1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-12 03:36:32 +00:00
OpenMW/apps/openmw/mwworld/actionopen.cpp
2015-03-11 20:04:25 +01:00

29 lines
691 B
C++

#include "actionopen.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/disease.hpp"
#include "class.hpp"
#include "containerstore.hpp"
namespace MWWorld
{
ActionOpen::ActionOpen (const MWWorld::Ptr& container, bool loot)
: Action (false, container)
, mLoot(loot)
{
}
void ActionOpen::executeImp (const MWWorld::Ptr& actor)
{
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return;
MWMechanics::diseaseContact(actor, getTarget());
MWBase::Environment::get().getWindowManager()->openContainer(getTarget(), mLoot);
}
}