1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Inventory#containsOnly()

Discussion in 'Client & Site Support' started by Defeat3d, May 4, 2015.

  1. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,070
    Likes Received:
    1,894
    Inventory#containsOnly() returns true when the inventory is empty.

    RS3 not confirmed.
     
  2. Infinite Inferno

    Infinite Inferno The Pip Collector

    Joined:
    Sep 14, 2014
    Messages:
    445
    Likes Received:
    122
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    That seems like desired behavior, it doesn't contain any items that aren't the specified items. Use containsOnly and containsAllOf or containsAnyOf depending on what behavior you want.
     
  4. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,070
    Likes Received:
    1,894
    But the method is called containsOnly, if the inventory contains nothing, then it doesn't contain?
     
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    It contains only items within the given array, even if there aren't technically any items in the inventory. Anything it does contain is within the given array.
     

Share This Page

Loading...