Merge pull request #898 from EgzoT/EgzoT-setPathable
Add setPathable() function
This commit is contained in:
commit
0a6e7dd74e
|
@ -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…
Reference in New Issue