Fixed the placement of wall sprites in the level editor to wait until the sprite sheet is finished being built.

This commit is contained in:
Scott Erickson 2014-05-22 14:16:39 -07:00
parent 5a407492db
commit bd575ad667
2 changed files with 3 additions and 3 deletions

View file

@ -293,7 +293,8 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
p1.z += bobOffset
x: p1.x, y: p1.y, z: if @thang.isLand then 0 else p1.z - @thang.depth / 2
updatePosition: ->
updatePosition: (log) ->
return if @stillLoading
return unless @thang?.pos and @options.camera?
wop = @getWorldPosition()
[p0, p1] = [@lastPos, @thang.pos]

View file

@ -201,8 +201,7 @@ module.exports = class SpriteBoss extends CocoClass
cache: (update=false) ->
return if @cached and not update
wallSprites = (sprite for sprite in @spriteArray when sprite.thangType?.get('name').search(/(dungeon|indoor).wall/i) isnt -1)
unless _.all (s.thangType.isFullyLoaded() for s in wallSprites)
return
return if _.any (s.stillLoading for s in wallSprites)
walls = (sprite.thang for sprite in wallSprites)
@world.calculateBounds()
wallGrid = new Grid walls, @world.size()...