1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:49:55 +00:00
openmw-tes3mp/apps/openmw/mwworld/actionrepair.cpp

30 lines
751 B
C++
Raw Normal View History

2013-03-23 07:16:46 +00:00
#include "actionrepair.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp"
2015-09-10 06:48:34 +00:00
#include "../mwmechanics/actorutil.hpp"
2013-03-23 07:16:46 +00:00
namespace MWWorld
{
ActionRepair::ActionRepair(const Ptr& item, bool force)
: Action (false, item)
, mForce(force)
2013-03-23 07:16:46 +00:00
{
}
void ActionRepair::executeImp (const Ptr& actor)
{
2015-09-10 06:48:34 +00:00
if (actor != MWMechanics::getPlayer())
return;
if(!mForce && MWMechanics::isPlayerInCombat())
{
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage2}");
return;
}
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Repair, getTarget());
2013-03-23 07:16:46 +00:00
}
}