1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/openmw/mwworld/actionalchemy.cpp

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

30 lines
719 B
C++
Raw Normal View History

#include "actionalchemy.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
2015-09-10 18:48:34 +12:00
#include "../mwmechanics/actorutil.hpp"
namespace MWWorld
{
ActionAlchemy::ActionAlchemy(bool force)
: Action(false)
, mForce(force)
{
}
2012-07-27 12:00:10 +02:00
void ActionAlchemy::executeImp(const Ptr& actor)
{
2015-09-10 18:48:34 +12:00
if (actor != MWMechanics::getPlayer())
return;
if (!mForce && MWMechanics::isPlayerInCombat())
{ // Ensure we're not in combat
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage3}");
return;
}
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Alchemy);
}
}