1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-23 10:20:48 +00:00

Resolve unused-lambda-capture warnings

This commit is contained in:
Petr Mikheev 2021-09-28 12:25:37 +02:00
parent 5794a3b346
commit eb2f863b7d
2 changed files with 6 additions and 8 deletions

View File

@ -51,8 +51,8 @@ namespace MWLua
std::array<bool, MWWorld::InventoryStore::Slots> usedSlots; std::array<bool, MWWorld::InventoryStore::Slots> usedSlots;
std::fill(usedSlots.begin(), usedSlots.end(), false); std::fill(usedSlots.begin(), usedSlots.end(), false);
constexpr int anySlot = -1; static constexpr int anySlot = -1;
auto tryEquipToSlot = [&actor, &store, &usedSlots, &worldView, anySlot](int slot, const Item& item) -> bool auto tryEquipToSlot = [&actor, &store, &usedSlots, &worldView](int slot, const Item& item) -> bool
{ {
auto old_it = slot != anySlot ? store.getSlot(slot) : store.end(); auto old_it = slot != anySlot ? store.getSlot(slot) : store.end();
MWWorld::Ptr itemPtr; MWWorld::Ptr itemPtr;

View File

@ -47,8 +47,6 @@ namespace MWLua
return LObject(getId(r.mHitObject), worldView->getObjectRegistry()); return LObject(getId(r.mHitObject), worldView->getObjectRegistry());
}); });
constexpr int defaultCollisionType = MWPhysics::CollisionType_World | MWPhysics::CollisionType_HeightMap |
MWPhysics::CollisionType_Actor | MWPhysics::CollisionType_Door;
api["COLLISION_TYPE"] = LuaUtil::makeReadOnly(context.mLua->sol().create_table_with( api["COLLISION_TYPE"] = LuaUtil::makeReadOnly(context.mLua->sol().create_table_with(
"World", MWPhysics::CollisionType_World, "World", MWPhysics::CollisionType_World,
"Door", MWPhysics::CollisionType_Door, "Door", MWPhysics::CollisionType_Door,
@ -56,12 +54,12 @@ namespace MWLua
"HeightMap", MWPhysics::CollisionType_HeightMap, "HeightMap", MWPhysics::CollisionType_HeightMap,
"Projectile", MWPhysics::CollisionType_Projectile, "Projectile", MWPhysics::CollisionType_Projectile,
"Water", MWPhysics::CollisionType_Water, "Water", MWPhysics::CollisionType_Water,
"Default", defaultCollisionType)); "Default", MWPhysics::CollisionType_Default));
api["castRay"] = [defaultCollisionType](const osg::Vec3f& from, const osg::Vec3f& to, sol::optional<sol::table> options) api["castRay"] = [](const osg::Vec3f& from, const osg::Vec3f& to, sol::optional<sol::table> options)
{ {
MWWorld::Ptr ignore; MWWorld::Ptr ignore;
int collisionType = defaultCollisionType; int collisionType = MWPhysics::CollisionType_Default;
float radius = 0; float radius = 0;
if (options) if (options)
{ {
@ -80,7 +78,7 @@ namespace MWLua
} }
}; };
// TODO: async raycasting // TODO: async raycasting
/*api["asyncCastRay"] = [luaManager = context.mLuaManager, defaultCollisionType]( /*api["asyncCastRay"] = [luaManager = context.mLuaManager](
const Callback& luaCallback, const osg::Vec3f& from, const osg::Vec3f& to, sol::optional<sol::table> options) const Callback& luaCallback, const osg::Vec3f& from, const osg::Vec3f& to, sol::optional<sol::table> options)
{ {
std::function<void(MWPhysics::RayCastingResult)> callback = std::function<void(MWPhysics::RayCastingResult)> callback =