mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 06:41:33 +00:00
Merge branch 'lua_activate' into 'master'
[Lua] Fix the bug that object:activate() doesn't trigger mwscripts See merge request OpenMW/openmw!1834
This commit is contained in:
commit
71e4e5ceec
1 changed files with 6 additions and 3 deletions
|
@ -95,10 +95,13 @@ namespace MWLua
|
||||||
if (actor.isEmpty())
|
if (actor.isEmpty())
|
||||||
throw std::runtime_error(std::string("Actor not found: " + idToString(mActor)));
|
throw std::runtime_error(std::string("Actor not found: " + idToString(mActor)));
|
||||||
|
|
||||||
|
if (object.getRefData().activate())
|
||||||
|
{
|
||||||
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
||||||
std::unique_ptr<MWWorld::Action> action = object.getClass().activate(object, actor);
|
std::unique_ptr<MWWorld::Action> action = object.getClass().activate(object, actor);
|
||||||
action->execute(actor);
|
action->execute(actor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string toString() const override
|
std::string toString() const override
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue