Thread Tools Display Modes
05/12/23, 11:37 PM   #1
UnDead 0rbit
AddOn Author - Click to view addons
Join Date: Aug 2020
Posts: 4
UseItem() not working

UseItem() claims to be protected in the Api, yet ingame im getting an attempt to use a private function error. is the api (wiki) out of date and this is changed or and I doing something wrong?

error:
Attempt to access a private function 'UseItem' from insecure code. The callstack became untrusted 2 stack frame(s) from the top.

Last edited by UnDead 0rbit : 05/12/23 at 11:40 PM.
  Reply With Quote
05/13/23, 12:06 AM   #2
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2020
Posts: 185
Originally Posted by UnDead 0rbit View Post
UseItem() claims to be protected in the Api, yet ingame im getting an attempt to use a private function error. is the api (wiki) out of date and this is changed or and I doing something wrong?

error:
Attempt to access a private function 'UseItem' from insecure code. The callstack became untrusted 2 stack frame(s) from the top.
Lua Code:
  1. if CanUseItem(bagId, slotIndex) then
  2.     -- UseItem is protected, so CallSecureProtected is used to make the call
  3.     local success = CallSecureProtected("UseItem", bagId, slotIndex)
  4.     return success
  5. end
  Reply With Quote
05/13/23, 12:09 AM   #3
UnDead 0rbit
AddOn Author - Click to view addons
Join Date: Aug 2020
Posts: 4
Originally Posted by Masteroshi430 View Post
Lua Code:
  1. if CanUseItem(bagId, slotIndex) then
  2.     -- UseItem is protected, so CallSecureProtected is used to make the call
  3.     local success = CallSecureProtected("UseItem", bagId, slotIndex)
  4.     return success
  5. end

Thanks for the help
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » UseItem() not working


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off