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:
Scott Erickson 2014-02-03 14:01:20 -08:00
parent 912b6140ac
commit 81912d25d1

View file

@ -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