Using aiSource now for enemy AIs in multiplayer, separate from sample code source.

This commit is contained in:
Nick Winter 2014-10-19 12:44:58 -07:00
parent 754f7128bd
commit 440e1700b1
3 changed files with 14 additions and 10 deletions

View file

@ -52,6 +52,7 @@ module.exports = class SaveLevelModal extends SaveVersionModal
console.log "Should we save", m.get('system'), m.get('name'), m, "? localChanges:", m.hasLocalChanges(), "version:", m.get('version'), 'isPublished:', m.isPublished(), 'collection:', m.collection
return false
return true if m.hasLocalChanges()
console.error "Trying to check major version of #{m.type()} #{m.get('name')}, but it doesn't have a version:", m unless m.get('version')
return true if (m.get('version').major is 0 and m.get('version').minor is 0) or not m.isPublished() and not m.collection
# Sometimes we have two versions: one in a search collection and one with a URL. We only save changes to the latter.
false

View file

@ -365,7 +365,8 @@ module.exports = class ThangTypeEditView extends RootView
url = "/editor/thang/#{newThangType.get('slug') or newThangType.id}"
portraitSource = null
if @thangType.get('raster')
image = @currentLank.sprite.image
#image = @currentLank.sprite.image # Doesn't work?
image = @currentLank.sprite.spriteSheet._images[0]
portraitSource = imageToPortrait image
# bit of a hacky way to get that portrait
success = =>

View file

@ -40,6 +40,8 @@ module.exports = class Spell
if @permissions.readwrite.length and sessionSource = @session.getSourceFor(@spellKey)
if sessionSource isnt '// Should fill in some default source\n' # TODO: figure out why session is getting this default source in there and stop it
@source = sessionSource
if p.aiSource and not @otherSession and not @canWrite()
@source = @originalSource = p.aiSource
@thangs = {}
if @canRead() # We can avoid creating these views if we'll never use them.
@view = new SpellView {spell: @, level: options.level, session: @session, worker: @worker}