mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-03 18:11:33 +00:00
Allow to handle activation in Lua even for mwscripted objects
This commit is contained in:
parent
62ef209185
commit
c5871a5a7a
2 changed files with 3 additions and 2 deletions
|
@ -274,6 +274,8 @@ namespace MWLua
|
||||||
});
|
});
|
||||||
|
|
||||||
api["_runStandardActivationAction"] = [context](const GObject& object, const GObject& actor) {
|
api["_runStandardActivationAction"] = [context](const GObject& object, const GObject& actor) {
|
||||||
|
if (!object.ptr().getRefData().activate())
|
||||||
|
return;
|
||||||
context.mLuaManager->addAction(
|
context.mLuaManager->addAction(
|
||||||
[object, actor] {
|
[object, actor] {
|
||||||
const MWWorld::Ptr& objPtr = object.ptr();
|
const MWWorld::Ptr& objPtr = object.ptr();
|
||||||
|
|
|
@ -3707,8 +3707,7 @@ namespace MWWorld
|
||||||
void World::activate(const Ptr& object, const Ptr& actor)
|
void World::activate(const Ptr& object, const Ptr& actor)
|
||||||
{
|
{
|
||||||
breakInvisibility(actor);
|
breakInvisibility(actor);
|
||||||
if (object.getRefData().activate())
|
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
||||||
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ResetActorsVisitor
|
struct ResetActorsVisitor
|
||||||
|
|
Loading…
Reference in a new issue