From cc04626a5afbca92a69f7069bd57364d5d96e763 Mon Sep 17 00:00:00 2001 From: Scott Erickson <sderickson@gmail.com> Date: Fri, 3 Oct 2014 11:21:05 -0700 Subject: [PATCH] Fixed walls not updating when you edit them in the ThangsTabView. --- app/lib/surface/LankBoss.coffee | 8 +++++--- app/views/editor/level/thangs/ThangsTabView.coffee | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/lib/surface/LankBoss.coffee b/app/lib/surface/LankBoss.coffee index a11ca17d5..16d511281 100644 --- a/app/lib/surface/LankBoss.coffee +++ b/app/lib/surface/LankBoss.coffee @@ -238,13 +238,15 @@ module.exports = class LankBoss extends CocoClass possiblyUpdatedWallLanks = (lank for lank in wallLanks when _.find updatedObstacles, (w2) -> lank is w2 or (Math.abs(lank.thang.pos.x - w2.thang.pos.x) + Math.abs(lank.thang.pos.y - w2.thang.pos.y)) <= 16) else possiblyUpdatedWallLanks = wallLanks - #console.log 'updating up to', possiblyUpdatedWallLanks.length, 'of', wallLanks.length, 'wall lanks from updatedObstacles', updatedObstacles +# console.log 'updating up to', possiblyUpdatedWallLanks.length, 'of', wallLanks.length, 'wall lanks from updatedObstacles', updatedObstacles for wallLank in possiblyUpdatedWallLanks + wallLank.queueAction 'idle' if not wallLank.currentRootAction + wallLank.lockAction(false) wallLank.updateActionDirection wallGrid - wallLank.lockAction() + wallLank.lockAction(true) wallLank.updateScale() wallLank.updatePosition() - #console.log @wallGrid.toString() +# console.log wallGrid.toString() @cachedObstacles = true lankFor: (thangID) -> @lanks[thangID] diff --git a/app/views/editor/level/thangs/ThangsTabView.coffee b/app/views/editor/level/thangs/ThangsTabView.coffee index 02b0ce8f8..bb44ac480 100644 --- a/app/views/editor/level/thangs/ThangsTabView.coffee +++ b/app/views/editor/level/thangs/ThangsTabView.coffee @@ -519,6 +519,7 @@ module.exports = class ThangsTabView extends CocoView console.error 'Catastrophic error loading the level:', error thang.isSelectable = not thang.isLand for thang in @world.thangs # let us select walls and such @surface?.setWorld @world + @surface?.lankBoss.cachedObstacles = false @selectAddThangType @addThangType, @cloneSourceThang if @addThangType # make another addThang sprite, since the World just refreshed # update selection, since the thangs have been remade