diff --git a/apps/openmw/mwlua/objectbindings.cpp b/apps/openmw/mwlua/objectbindings.cpp index 6d32240565..d87f0de37d 100644 --- a/apps/openmw/mwlua/objectbindings.cpp +++ b/apps/openmw/mwlua/objectbindings.cpp @@ -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 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;