Fix adding inventory items to hero in level editor

Was only happening when HeroPlaceholder had HasPet component.
Presumably because the collection was loaded by HasPet, but the thang node
for the inventory node needed to populate its autocomplete array.
This commit is contained in:
Scott Erickson 2016-06-06 15:35:10 -07:00
parent 53a7510c46
commit be78f4049c
2 changed files with 5 additions and 2 deletions

View file

@ -119,4 +119,4 @@ class SolutionsNode extends TreemaArrayNode
succeeds: true
})
@set('/', solutions)
@set('/', solutions)

View file

@ -260,7 +260,10 @@ module.exports.ThangTypeNode = ThangTypeNode = class ThangTypeNode extends Treem
thangType?.name or '...'
getThangTypes: ->
return if ThangTypeNode.thangTypesCollection
if ThangTypeNode.thangTypesCollection
if not @constructor.thangTypes
@processThangTypes(ThangTypeNode.thangTypesCollection)
return
ThangTypeNode.thangTypesCollection = new CocoCollection([], {
url: '/db/thang.type'
project:['name', 'components', 'original']