mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fix thangTypes filtering in serialize
This commit is contained in:
parent
7864d3708b
commit
ed17d967d2
1 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,13 @@ module.exports = class Level extends CocoModel
|
|||
# Figure out ThangTypes' Components
|
||||
tmap = {}
|
||||
tmap[t.thangType] = true for t in o.thangs ? []
|
||||
o.thangTypes = (original: tt.get('original'), name: tt.get('name'), components: $.extend(true, [], tt.get('components')) for tt in supermodel.getModels ThangType when tmap[tt.get('original')] or (tt.get('components') and not tt.notInLevel))
|
||||
heroSelected = session.get('heroConfig').thangType
|
||||
o.thangTypes = []
|
||||
for tt in supermodel.getModels ThangType
|
||||
if tmap[tt.get('original')] or
|
||||
(tt.get('kind') isnt 'Hero' and tt.get('kind')? and tt.get('components') and not tt.notInLevel) or
|
||||
(tt.get('kind') is 'Hero' and tt.get('original') is heroSelected)
|
||||
o.thangTypes.push (original: tt.get('original'), name: tt.get('name'), components: $.extend(true, [], tt.get('components')))
|
||||
@sortThangComponents o.thangTypes, o.levelComponents, 'ThangType'
|
||||
@fillInDefaultComponentConfiguration o.thangTypes, o.levelComponents
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue