diff --git a/src/client/luafunctions.cpp b/src/client/luafunctions.cpp index 2ceb26e6..e8344792 100644 --- a/src/client/luafunctions.cpp +++ b/src/client/luafunctions.cpp @@ -526,6 +526,7 @@ void Client::registerLuaFunctions() g_lua.bindClassMemberFunction("isNotMoveable", &ThingType::isNotMoveable); g_lua.bindClassMemberFunction("blockProjectile", &ThingType::blockProjectile); g_lua.bindClassMemberFunction("isNotPathable", &ThingType::isNotPathable); + g_lua.bindClassMemberFunction("setPathable", &ThingType::setPathable); g_lua.bindClassMemberFunction("isPickupable", &ThingType::isPickupable); g_lua.bindClassMemberFunction("isHangable", &ThingType::isHangable); g_lua.bindClassMemberFunction("isHookSouth", &ThingType::isHookSouth); diff --git a/src/client/thingtype.cpp b/src/client/thingtype.cpp index 7a9fb5b1..28d6b3b6 100644 --- a/src/client/thingtype.cpp +++ b/src/client/thingtype.cpp @@ -564,3 +564,11 @@ int ThingType::getExactSize(int layer, int xPattern, int yPattern, int zPattern, Size size = m_texturesFramesOriginRects[animationPhase][frameIndex].size() - m_texturesFramesOffsets[animationPhase][frameIndex].toSize(); return std::max(size.width(), size.height()); } + +void ThingType::setPathable(bool var) +{ + if(var == true) + m_attribs.remove(ThingAttrNotPathable); + else + m_attribs.set(ThingAttrNotPathable, true); +} \ No newline at end of file diff --git a/src/client/thingtype.h b/src/client/thingtype.h index 278df324..ac95f101 100644 --- a/src/client/thingtype.h +++ b/src/client/thingtype.h @@ -206,6 +206,7 @@ public: // additional float getOpacity() { return m_opacity; } bool isNotPreWalkable() { return m_attribs.has(ThingAttrNotPreWalkable); } + void setPathable(bool var); private: const TexturePtr& getTexture(int animationPhase);