     @surface?.spriteBoss?.selectSprite null, null
 
   onSpriteMouseDown: (e) ->
+    @dragged = false
     # Sprite clicks happen after stage clicks, but we need to know whether a sprite is being clicked.
     # clearTimeout @backgroundAddClickTimeout
     # if e.originalEvent.nativeEvent.button == 2

    'editor:view-switched': 'onViewSwitched'
    'sprite:dragged': 'onSpriteDragged'
    'sprite:mouse-up': 'onSpriteMouseUp'
    'sprite:double-clicked': 'onSpriteDoubleClicked'
    'surface:stage-mouse-up': 'onStageMouseUp'
    'editor:random-terrain-generated': 'onRandomTerrainGenerated'

    @thangsTreema.set path + '/config/pos', x: pos.x, y: pos.y, z: pos.z

  onSpriteDoubleClicked: (e) ->
    return unless e.thang and not @dragged
    @editThang thangID: e.thang.id

  onRandomTerrainGenerated: (e) ->
