Skip to content
Snippets Groups Projects
Commit 097ecacf authored by dg's avatar dg
Browse files

Use item in the inventory screen will notify that it is impossible to use...

Use item in the inventory screen will notify that it is impossible to use items without wearing them (when appropriate)


git-svn-id: http://svn.net-core.org/repos/t-engine4@4481 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7c0d7ddb
No related branches found
No related tags found
No related merge requests found
......@@ -60,8 +60,12 @@ function _M:use(item)
local act = item.action
if act == "use" then
self.actor:playerUseItem(self.object, self.item, self.inven, self.onuse)
self.onuse(self.inven, self.item, self.object, true)
if self.object:wornInven() and not self.object.wielded and not self.object.use_no_wear then
self:simplePopup("Impossible", "You must wear this object to use it!")
else
self.actor:playerUseItem(self.object, self.item, self.inven, self.onuse)
self.onuse(self.inven, self.item, self.object, true)
end
elseif act == "drop" then
self.actor:doDrop(self.inven, self.item, function() self.onuse(self.inven, self.item, self.object, false) end)
elseif act == "wear" then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment