Merge pull request #898 from EgzoT/EgzoT-setPathable

Add setPathable() function
master
Eduardo Bart 6 年之前 committed by GitHub
當前提交 0a6e7dd74e
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 4AEE18F83AFDEB23

@ -526,6 +526,7 @@ void Client::registerLuaFunctions()
g_lua.bindClassMemberFunction<ThingType>("isNotMoveable", &ThingType::isNotMoveable);
g_lua.bindClassMemberFunction<ThingType>("blockProjectile", &ThingType::blockProjectile);
g_lua.bindClassMemberFunction<ThingType>("isNotPathable", &ThingType::isNotPathable);
g_lua.bindClassMemberFunction<ThingType>("setPathable", &ThingType::setPathable);
g_lua.bindClassMemberFunction<ThingType>("isPickupable", &ThingType::isPickupable);
g_lua.bindClassMemberFunction<ThingType>("isHangable", &ThingType::isHangable);
g_lua.bindClassMemberFunction<ThingType>("isHookSouth", &ThingType::isHookSouth);

@ -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<int>(size.width(), size.height());
}
void ThingType::setPathable(bool var)
{
if(var == true)
m_attribs.remove(ThingAttrNotPathable);
else
m_attribs.set(ThingAttrNotPathable, true);
}

@ -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);

Loading…
取消
儲存