Move local variables

fix-osga-rotate-wildly
Andrei Kortunov 10 months ago
parent 1126f38a1e
commit cf6b6020a0

@ -163,8 +163,8 @@ namespace MWLua
ignore = parseIgnoreList(*options);
}
context.mLuaManager->addAction([context, ignore, callback = LuaUtil::Callback::fromLua(callback), from,
to] {
context.mLuaManager->addAction([context, ignore = std::move(ignore),
callback = LuaUtil::Callback::fromLua(callback), from, to] {
MWPhysics::RayCastingResult res;
MWBase::Environment::get().getWorld()->castRenderingRay(res, from, to, false, false, ignore);
context.mLuaManager->queueCallback(callback, sol::main_object(context.mLua->sol(), sol::in_place, res));

@ -94,7 +94,7 @@ namespace LuaUtil
sol::table callbackMeta = Callback::makeMetatable(L);
api["callback"] = [callbackMeta](const AsyncPackageId& asyncId, sol::main_protected_function fn) -> sol::table {
return Callback::make(asyncId, fn, callbackMeta);
return Callback::make(asyncId, std::move(fn), callbackMeta);
};
auto initializer = [](sol::table hiddenData) {

Loading…
Cancel
Save