mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Added a handler for when components or systems go rogue, so they don't take down the level editor quite so hard.
This commit is contained in:
parent
912b6140ac
commit
81912d25d1
1 changed files with 4 additions and 1 deletions
|
@ -333,7 +333,10 @@ module.exports = class ThangsTabView extends View
|
||||||
onThangsChanged: (e) =>
|
onThangsChanged: (e) =>
|
||||||
@level.set 'thangs', @thangsTreema.data
|
@level.set 'thangs', @thangsTreema.data
|
||||||
serializedLevel = @level.serialize @supermodel
|
serializedLevel = @level.serialize @supermodel
|
||||||
|
try
|
||||||
@world.loadFromLevel serializedLevel, false
|
@world.loadFromLevel serializedLevel, false
|
||||||
|
catch error
|
||||||
|
console.error 'Catastrophic error loading the level:', error
|
||||||
thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such
|
thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such
|
||||||
@surface?.setWorld @world
|
@surface?.setWorld @world
|
||||||
@selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed
|
@selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed
|
||||||
|
|
Loading…
Reference in a new issue