mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-05 15:40:10 +00:00
Merge branch 'fix' into 'master'
Resolve warning: lambda capture 'defaultCollisionType' is not required to be captured for this use See merge request OpenMW/openmw!1247
This commit is contained in:
commit
9cf9da9cbd
@ -51,8 +51,8 @@ namespace MWLua
|
||||
std::array<bool, MWWorld::InventoryStore::Slots> usedSlots;
|
||||
std::fill(usedSlots.begin(), usedSlots.end(), false);
|
||||
|
||||
constexpr int anySlot = -1;
|
||||
auto tryEquipToSlot = [&actor, &store, &usedSlots, &worldView, anySlot](int slot, const Item& item) -> bool
|
||||
static constexpr int anySlot = -1;
|
||||
auto tryEquipToSlot = [&actor, &store, &usedSlots, &worldView](int slot, const Item& item) -> bool
|
||||
{
|
||||
auto old_it = slot != anySlot ? store.getSlot(slot) : store.end();
|
||||
MWWorld::Ptr itemPtr;
|
||||
|
@ -47,8 +47,6 @@ namespace MWLua
|
||||
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(
|
||||
"World", MWPhysics::CollisionType_World,
|
||||
"Door", MWPhysics::CollisionType_Door,
|
||||
@ -56,12 +54,12 @@ namespace MWLua
|
||||
"HeightMap", MWPhysics::CollisionType_HeightMap,
|
||||
"Projectile", MWPhysics::CollisionType_Projectile,
|
||||
"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;
|
||||
int collisionType = defaultCollisionType;
|
||||
int collisionType = MWPhysics::CollisionType_Default;
|
||||
float radius = 0;
|
||||
if (options)
|
||||
{
|
||||
@ -80,7 +78,7 @@ namespace MWLua
|
||||
}
|
||||
};
|
||||
// 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)
|
||||
{
|
||||
std::function<void(MWPhysics::RayCastingResult)> callback =
|
||||
|
Loading…
x
Reference in New Issue
Block a user