Removed hero team color in non-multiplayer levels.

This commit is contained in:
Nick Winter 2014-11-23 20:04:07 -08:00
parent df162080c3
commit cbf3aab374
2 changed files with 4 additions and 0 deletions

View file

@ -330,6 +330,8 @@ module.exports = class LevelLoader extends CocoClass
@grabTeamConfigs()
@thangTypeTeams = {}
for thang in @level.get('thangs')
if @level.get('type', true) is 'hero' and thang.id is 'Hero Placeholder'
continue # No team colors for heroes on single-player levels
for component in thang.components
if team = component.config?.team
@thangTypeTeams[thang.thangType] ?= []

View file

@ -173,6 +173,8 @@ module.exports = class Thang
getLankOptions: ->
colorConfigs = @teamColors or @world?.getTeamColors() or {}
options = {colorConfig: {}}
if @id is 'Hero Placeholder' and not @world.getThangByID 'Hero Placeholder 1'
return options # No team colors for heroes on single-player levels
if @team and teamColor = colorConfigs[@team]
options.colorConfig.team = teamColor
if @color and color = @grabColorConfig @color