mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-14 11:43:07 +00:00
Merge branch 'lua_restock' into 'master'
Add isRestocking to types.Item See merge request OpenMW/openmw!3383
This commit is contained in:
commit
a0d3313d8d
2 changed files with 9 additions and 0 deletions
|
|
@ -12,5 +12,7 @@ namespace MWLua
|
||||||
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
|
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
|
||||||
item["setEnchantmentCharge"]
|
item["setEnchantmentCharge"]
|
||||||
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
|
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
|
||||||
|
item["isRestocking"]
|
||||||
|
= [](const Object& object) -> bool { return object.ptr().getRefData().getCount(false) < 0; };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -632,6 +632,13 @@
|
||||||
-- @param openmw.core#GameObject item
|
-- @param openmw.core#GameObject item
|
||||||
-- @return #number The charge remaining. -1 if the enchantment has never been used, implying the charge is full. Unenchanted items will always return a value of -1.
|
-- @return #number The charge remaining. -1 if the enchantment has never been used, implying the charge is full. Unenchanted items will always return a value of -1.
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Checks if the item restocks.
|
||||||
|
-- Returns true if the object restocks, and false otherwise.
|
||||||
|
-- @function [parent=#Item] isRestocking
|
||||||
|
-- @param openmw.core#GameObject item
|
||||||
|
-- @return #boolean
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Set this item's enchantment charge.
|
-- Set this item's enchantment charge.
|
||||||
-- @function [parent=#Item] setEnchantmentCharge
|
-- @function [parent=#Item] setEnchantmentCharge
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue