Results 1 to 3 of 3

Thread: [Bug] HasAnyAvailableInventorySpace() counts wards as empty slots

  1. #1
    Basic Member
    Join Date
    Jun 2012
    Posts
    184

    [Bug] HasAnyAvailableInventorySpace() counts wards as empty slots

    CDOTA_BaseNPC_Hero:HasAnyAvailableInventorySpace() seems to think that Observer and Sentry Wards (though apparently not other consumables like Clarity) are empty slots. Therefore, calling this function will return true even if all six slots are filled, so long as one or more wards take up one of the slots.

    If you want to crash your game with an infinite loop like I did, buy some wards and run the following code:
    Code:
    while keys.caster:HasAnyAvailableInventorySpace() do  --Fill all empty slots in the player's inventory with "dummy" items.
    	keys.caster:AddItem(CreateItem("item_dummy", keys.caster, keys.caster))
    end

  2. #2
    Basic Member Dun1007's Avatar
    Join Date
    Nov 2014
    Posts
    62
    Can confirm. I am now looping through inventory to find space because of this.

  3. #3
    Basic Member Noya's Avatar
    Join Date
    Dec 2011
    Location
    Uruguay
    Posts
    12,904
    Added, thanks for the confirmation

Posting Permissions

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