1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-17 11:43:25 +00:00

Allow to handle activation in Lua even for mwscripted objects

This commit is contained in:
Petr Mikheev 2023-07-22 16:57:39 +02:00
parent 62ef209185
commit c5871a5a7a
2 changed files with 3 additions and 2 deletions

View File

@ -274,6 +274,8 @@ namespace MWLua
});
api["_runStandardActivationAction"] = [context](const GObject& object, const GObject& actor) {
if (!object.ptr().getRefData().activate())
return;
context.mLuaManager->addAction(
[object, actor] {
const MWWorld::Ptr& objPtr = object.ptr();

View File

@ -3707,8 +3707,7 @@ namespace MWWorld
void World::activate(const Ptr& object, const Ptr& actor)
{
breakInvisibility(actor);
if (object.getRefData().activate())
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
MWBase::Environment::get().getLuaManager()->objectActivated(object, actor);
}
struct ResetActorsVisitor