1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 09:45:36 +00:00

implemented basic object activation

This commit is contained in:
Marc Zinnschlag 2010-08-05 13:51:26 +02:00
parent 2d695cc806
commit f630157bf8

View file

@ -269,5 +269,19 @@ void OMW::Engine::go()
void OMW::Engine::activate()
{
std::cout << "activate" << std::endl;
std::string handle = mEnvironment.mWorld->getFacedHandle();
if (handle.empty())
return;
MWWorld::Ptr ptr = mEnvironment.mWorld->getPtrViaHandle (handle);
if (ptr.isEmpty())
return;
boost::shared_ptr<MWWorld::Action> action =
MWWorld::Class::get (ptr).activate (ptr, mEnvironment.mWorld->getPlayerPos().getPlayer(),
mEnvironment);
action->execute (mEnvironment);
}