diff --git a/apps/openmw/mwlua/objectbindings.cpp b/apps/openmw/mwlua/objectbindings.cpp index 5e5c380469..01ef08ffdb 100644 --- a/apps/openmw/mwlua/objectbindings.cpp +++ b/apps/openmw/mwlua/objectbindings.cpp @@ -159,6 +159,10 @@ namespace MWLua [](const ObjectT& o) -> osg::Vec3f { return o.ptr().getRefData().getPosition().asVec3(); }); objectT["rotation"] = sol::readonly_property( [](const ObjectT& o) -> osg::Vec3f { return o.ptr().getRefData().getPosition().asRotationVec3(); }); + objectT["startingPosition"] = sol::readonly_property( + [](const ObjectT& o) -> osg::Vec3f { return o.ptr().getCellRef().getPosition().asVec3(); }); + objectT["startingRotation"] = sol::readonly_property( + [](const ObjectT& o) -> osg::Vec3f { return o.ptr().getCellRef().getPosition().asRotationVec3(); }); objectT["getBoundingBox"] = [](const ObjectT& o) { MWRender::RenderingManager* renderingManager = MWBase::Environment::get().getWorld()->getRenderingManager(); diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index 47485c22c6..fa56a1c80e 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -111,6 +111,8 @@ -- @field #boolean enabled Whether the object is enabled or disabled. Global scripts can set the value. Items in containers or inventories can't be disabled. -- @field openmw.util#Vector3 position Object position. -- @field openmw.util#Vector3 rotation Object rotation (ZXY order). +-- @field openmw.util#Vector3 startingPosition The object original position +-- @field openmw.util#Vector3 startingRotation The object original rotation -- @field #string ownerRecordId NPC who owns the object (nil if missing). Global and self scripts can set the value. -- @field #string ownerFactionId Faction who owns the object (nil if missing). Global and self scripts can set the value. -- @field #number ownerFactionRank Rank required to be allowed to pick up the object. Global and self scripts can set the value.