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

29 lines
714 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"
#include "../mwworld/player.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)
: Action(false, item)
{
}
void ActionRepair::executeImp (const Ptr& actor)
{
2015-09-10 06:48:34 +00:00
if (actor != MWMechanics::getPlayer())
return;
2015-09-10 06:48:34 +00:00
if(MWMechanics::isPlayerInCombat()) {
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage2}");
return;
}
2013-03-23 07:16:46 +00:00
MWBase::Environment::get().getWindowManager()->startRepairItem(getTarget());
}
}