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:
parent
2d695cc806
commit
f630157bf8
1 changed files with 15 additions and 1 deletions
|
@ -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…
Reference in a new issue