mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-08 20:05:19 -04:00
Fix optional vals
This commit is contained in:
parent
855fa1e06e
commit
20b9ca2fe9
@ -501,10 +501,11 @@ namespace MWLua
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
objectT["setTransform"] = [context](const GObject& object, const osg::Vec3f& newPos,
|
objectT["setTransform"] = [context](const GObject& object, const osg::Vec3f& newPos,
|
||||||
const sol::object& newRotObj, bool terrainClamp = true) {
|
sol::object newRotObj, sol::optional<bool> terrainClampOpt) {
|
||||||
|
bool terrainClamp = terrainClampOpt.value_or(true);
|
||||||
MWWorld::Ptr ptr = object.ptr();
|
MWWorld::Ptr ptr = object.ptr();
|
||||||
if (ptr.getCellRef().getCount() == 0 || !ptr.isInCell())
|
if (ptr.getCellRef().getCount() == 0 || !ptr.isInCell())
|
||||||
throw std::runtime_error("Object is either removed or already in the process of teleporting");
|
throw std::runtime_error("Object is either removed or in the process of teleporting");
|
||||||
|
|
||||||
osg::Vec3f finalPos = newPos;
|
osg::Vec3f finalPos = newPos;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user