diff --git a/apps/openmw/mwlua/objectbindings.cpp b/apps/openmw/mwlua/objectbindings.cpp index 9c629aa2c0..5a14053fcf 100644 --- a/apps/openmw/mwlua/objectbindings.cpp +++ b/apps/openmw/mwlua/objectbindings.cpp @@ -357,7 +357,7 @@ namespace MWLua [cell, pos, rot] { teleportPlayer(cell, pos, rot); }); else context.mLuaManager->addAction( - [object, cell, pos, rot] { teleportNotPlayer(object.ptr(), cell, pos, rot); }, + [obj = Object(ptr), cell, pos, rot] { teleportNotPlayer(obj.ptr(), cell, pos, rot); }, "TeleportAction"); }; }