Fix optional vals

This commit is contained in:
SkyHasACat 2025-08-01 08:03:51 -07:00
parent 855fa1e06e
commit 20b9ca2fe9

View File

@ -501,10 +501,11 @@ namespace MWLua
});
};
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();
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;