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

29 lines
714 B
C++
Raw Normal View History

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