mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
Using aiSource now for enemy AIs in multiplayer, separate from sample code source.
This commit is contained in:
parent
754f7128bd
commit
440e1700b1
3 changed files with 14 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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 = =>
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue