Results 1 to 3 of 3

Thread: getSelectedObjects() errors out on items in bags

  1. #1

    getSelectedObjects() errors out on items in bags

    getSelectedObjects() will throw an error if one of the objects you have selected has been destroyed either by a script or putting it into a bag.

    Steps:

    Ctrl-select an object
    Put object in a bag
    Without changing your selection, click a button that calls getSelectedObjects(). You'll get an error

    Error in Script(Functionname - guid) function <Functionname>:

    There is no additional error message, just this line.

    It seems to me that object guids are not removed from the selection group when they are destroyed, and then cause it to fail when you call getSelectedObjects()

  2. #2
    i also tried using pcall() to trap the error and it didnt work --- it still spits out the same error and aborts without returning a result

  3. #3
    Can confirm all of the above.

    Player.getSelectedObjects() throws a nondescript error if the player has destroyed an item (if they deleted the object or dropped it into a bag for example) and has not since clicked to deselect or to select anything else.
    Clicking a button will not deselect the object, and thus the script will break there if the button attempts to call Player.getSelectedObjects().

    Additionally, pcall() cannot be used to catch this error and continue the script. There is no workaround for scripters to use until this issue is fixed.

Similar Threads

  1. P2P Errors.
    By RuthlessNarwhal in forum Bug Reports
    Replies: 42
    Last Post: 11-04-2017, 02:24 PM
  2. Replies: 8
    Last Post: 07-11-2017, 06:53 PM
  3. Replies: 0
    Last Post: 01-23-2017, 06:37 PM
  4. [ADDED] Deal items from bags
    By Bracket in forum Suggestions
    Replies: 3
    Last Post: 05-01-2016, 01:49 PM
  5. Small improvement on putting items in bags
    By Unreal_Ed in forum Suggestions
    Replies: 1
    Last Post: 02-15-2016, 06:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •