mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-23 11:27:21 -04:00
Make sure #3303 works for multiplayer and future 'course' level hero selection
This commit is contained in:
parent
345036f68f
commit
01a3ae6020
1 changed files with 2 additions and 2 deletions
|
@ -28,12 +28,12 @@ module.exports = class Level extends CocoModel
|
|||
# Figure out ThangTypes' Components
|
||||
tmap = {}
|
||||
tmap[t.thangType] = true for t in o.thangs ? []
|
||||
heroSelected = session.get('heroConfig').thangType
|
||||
sessionHeroes = [session.get('heroConfig')?.thangType, otherSession?.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)
|
||||
(tt.get('kind') is 'Hero' and ((@get('type', true) in ['course', 'course-ladder']) or tt.get('original') in sessionHeroes))
|
||||
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…
Reference in a new issue