mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-02 15:26:39 +00:00
[Lua] Fix the bug the object:activate() doesn't trigger mwscripts
This commit is contained in:
parent
a9767f1ffc
commit
2d1d7e644c
1 changed files with 6 additions and 3 deletions
|
|
@ -95,9 +95,12 @@ 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)));
|
||||||
|
|
||||||
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
if (object.getRefData().activate())
|
||||||
std::unique_ptr<MWWorld::Action> action = object.getClass().activate(object, actor);
|
{
|
||||||
action->execute(actor);
|
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
||||||
|
std::unique_ptr<MWWorld::Action> action = object.getClass().activate(object, actor);
|
||||||
|
action->execute(actor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string toString() const override
|
std::string toString() const override
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue