Better error messages for missing Component dependencies.

This commit is contained in:
Nick Winter 2014-03-09 11:46:53 -07:00
parent 9e56540cee
commit 03abbc44cb

View file

@ -52,13 +52,14 @@ module.exports = class Level extends CocoModel
visit = (c) ->
return if c in sorted
lc = _.find levelComponents, {original: c.original}
console.error "Couldn't find lc for", c unless lc
console.error thang.id, "couldn't find lc for", c unless lc
if lc.name is "Programmable"
# Programmable always comes last
visit c2 for c2 in _.without thang.components, c
else
for d in lc.dependencies or []
c2 = _.find thang.components, {original: d.original}
console.error thang.id, "couldn't find dependent Component", d.original, "from", lc.name unless c2
visit c2
if lc.name is "Collides"
allied = _.find levelComponents, {name: "Allied"}