1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwworld/actionalchemy.cpp
2019-02-19 18:40:33 +03:00

30 lines
711 B
C++

#include "actionalchemy.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwmechanics/actorutil.hpp"
namespace MWWorld
{
ActionAlchemy::ActionAlchemy(bool force)
: Action (false)
, mForce(force)
{
}
void ActionAlchemy::executeImp (const Ptr& actor)
{
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);
}
}