mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Made sure session objects are loaded from the server fresh, no caching.
This commit is contained in:
parent
13caae2690
commit
d55e4cd624
3 changed files with 6 additions and 3 deletions
|
@ -45,7 +45,10 @@ module.exports = class LevelLoader extends CocoClass
|
|||
|
||||
@session = new LevelSession()
|
||||
@session.url = -> url
|
||||
@session.fetch()
|
||||
|
||||
# Unless you specify cache:false, sometimes the browser will use a cached session
|
||||
# and players will 'lose' code
|
||||
@session.fetch({cache:false})
|
||||
@session.once 'sync', @onSessionLoaded, @
|
||||
|
||||
if @opponentSessionID
|
||||
|
|
|
@ -252,7 +252,7 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
# Marks
|
||||
|
||||
updateSelection: ->
|
||||
if @selectedSprite and (not @selectedSprite.thang.exists or not @world.getThangByID @selectedSprite.thang.id)
|
||||
if @selectedSprite?.thang and (not @selectedSprite.thang.exists or not @world.getThangByID @selectedSprite.thang.id)
|
||||
@selectSprite null, null, null
|
||||
@updateTarget()
|
||||
return unless @selectionMark
|
||||
|
|
|
@ -81,7 +81,7 @@ class CocoModel extends Backbone.Model
|
|||
return super attrs, options
|
||||
|
||||
fetch: ->
|
||||
super()
|
||||
super(arguments...)
|
||||
@loading = true
|
||||
|
||||
markToRevert: ->
|
||||
|
|
Loading…
Reference in a new issue