mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 03:39:55 +00:00
implemented basic object activation
This commit is contained in:
parent
2d695cc806
commit
f630157bf8
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user