1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 06:09:42 +00:00

Merge branch 'lua_restock' into 'master'

Add isRestocking to types.Item

See merge request OpenMW/openmw!3383
This commit is contained in:
psi29a 2023-08-29 07:07:06 +00:00
commit a0d3313d8d
2 changed files with 9 additions and 0 deletions

View file

@ -12,5 +12,7 @@ namespace MWLua
= [](const Object& object) { return object.ptr().getCellRef().getEnchantmentCharge(); };
item["setEnchantmentCharge"]
= [](const GObject& object, float charge) { object.ptr().getCellRef().setEnchantmentCharge(charge); };
item["isRestocking"]
= [](const Object& object) -> bool { return object.ptr().getRefData().getCount(false) < 0; };
}
}

View file

@ -632,6 +632,13 @@
-- @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.
---
-- 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.
-- @function [parent=#Item] setEnchantmentCharge