Add setPathable() function
Adding function who changing item attribute (ThingAttrNotPathable). Allows to walk on not pathable items (ThingAttrNotPathable -> true) like parcels, fire fields etc. and vice versa. Modifying item attribute without editing items sources files. Temporary action for the duration of the client session. Usage: print(g_things.getThingType(3504):isNotPathable()) -> true g_things.getThingType(3504):setPathable(true) print(g_things.getThingType(3504):isNotPathable()) -> false Helpful for highter levels players to ignoring "avoiding" fire/energy/poison fields etc. when using map click.
This commit is contained in:
parent
2095951e07
commit
c51df93e3e
|
@ -526,6 +526,7 @@ void Client::registerLuaFunctions()
|
||||||
g_lua.bindClassMemberFunction<ThingType>("isNotMoveable", &ThingType::isNotMoveable);
|
g_lua.bindClassMemberFunction<ThingType>("isNotMoveable", &ThingType::isNotMoveable);
|
||||||
g_lua.bindClassMemberFunction<ThingType>("blockProjectile", &ThingType::blockProjectile);
|
g_lua.bindClassMemberFunction<ThingType>("blockProjectile", &ThingType::blockProjectile);
|
||||||
g_lua.bindClassMemberFunction<ThingType>("isNotPathable", &ThingType::isNotPathable);
|
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>("isPickupable", &ThingType::isPickupable);
|
||||||
g_lua.bindClassMemberFunction<ThingType>("isHangable", &ThingType::isHangable);
|
g_lua.bindClassMemberFunction<ThingType>("isHangable", &ThingType::isHangable);
|
||||||
g_lua.bindClassMemberFunction<ThingType>("isHookSouth", &ThingType::isHookSouth);
|
g_lua.bindClassMemberFunction<ThingType>("isHookSouth", &ThingType::isHookSouth);
|
||||||
|
|
|
@ -178,6 +178,7 @@ public:
|
||||||
bool isNotMoveable() { return m_attribs.has(ThingAttrNotMoveable); }
|
bool isNotMoveable() { return m_attribs.has(ThingAttrNotMoveable); }
|
||||||
bool blockProjectile() { return m_attribs.has(ThingAttrBlockProjectile); }
|
bool blockProjectile() { return m_attribs.has(ThingAttrBlockProjectile); }
|
||||||
bool isNotPathable() { return m_attribs.has(ThingAttrNotPathable); }
|
bool isNotPathable() { return m_attribs.has(ThingAttrNotPathable); }
|
||||||
|
void setPathable(bool var) { var == true ? m_attribs.remove(ThingAttrNotPathable) : m_attribs.set(ThingAttrNotPathable, true); }
|
||||||
bool isPickupable() { return m_attribs.has(ThingAttrPickupable); }
|
bool isPickupable() { return m_attribs.has(ThingAttrPickupable); }
|
||||||
bool isHangable() { return m_attribs.has(ThingAttrHangable); }
|
bool isHangable() { return m_attribs.has(ThingAttrHangable); }
|
||||||
bool isHookSouth() { return m_attribs.has(ThingAttrHookSouth); }
|
bool isHookSouth() { return m_attribs.has(ThingAttrHookSouth); }
|
||||||
|
|
Loading…
Reference in New Issue