mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-30 07:53:45 -04:00
Merge pull request #3303 from taptapdan/fix-issue-3299
Fix thangTypes filtering in serialize
This commit is contained in:
commit
345036f68f
1 changed files with 7 additions and 1 deletions
|
@ -28,7 +28,13 @@ module.exports = class Level extends CocoModel
|
||||||
# Figure out ThangTypes' Components
|
# Figure out ThangTypes' Components
|
||||||
tmap = {}
|
tmap = {}
|
||||||
tmap[t.thangType] = true for t in o.thangs ? []
|
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'
|
@sortThangComponents o.thangTypes, o.levelComponents, 'ThangType'
|
||||||
@fillInDefaultComponentConfiguration o.thangTypes, o.levelComponents
|
@fillInDefaultComponentConfiguration o.thangTypes, o.levelComponents
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue