1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00
OpenMW/apps/openmw/mwworld/actioneat.cpp
Emanuel Guevel 1e4a854433 Remove static method MWWorld::Class::get(&Ptr)
It was just adding a level of indirection to Ptr.getClass().
All the call were replaced by that instead. The number of lines changed
is important, but the change itself is trivial, so everything should be
fine. :)
2014-05-22 20:50:00 +02:00

31 lines
763 B
C++

#include "actioneat.hpp"
#include <cstdlib>
#include <components/esm/loadskil.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/containerstore.hpp"
#include "class.hpp"
namespace MWWorld
{
void ActionEat::executeImp (const Ptr& actor)
{
// remove used item (assume the item is present in inventory)
getTarget().getContainerStore()->remove(getTarget(), 1, actor);
// apply to actor
std::string id = getTarget().getClass().getId (getTarget());
if (actor.getClass().apply (actor, id, actor))
actor.getClass().skillUsageSucceeded (actor, ESM::Skill::Alchemy, 1);
}
ActionEat::ActionEat (const MWWorld::Ptr& object) : Action (false, object) {}
}