mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Better handling of non-user-code problems in game-dev mode. Don't simulate whole level first time a game-dev level is loaded.
This commit is contained in:
parent
80f8fd60d8
commit
878dcbdc49
3 changed files with 9 additions and 3 deletions
|
@ -507,6 +507,11 @@ self.onWorldError = function onWorldError(error) {
|
|||
}
|
||||
else {
|
||||
console.log("Non-UserCodeError:", error.toString() + "\n" + error.stack || error.stackTrace);
|
||||
if(self.world.indefiniteLength) {
|
||||
// We don't abort completely, since the player can always click to end the game.
|
||||
// TODO: some better error to the user would be nice, though.
|
||||
return true;
|
||||
}
|
||||
self.postMessage({type: 'non-user-code-problem', problem: {message: error.toString()}});
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ module.exports = class Angel extends CocoClass
|
|||
@running = false
|
||||
@work = null
|
||||
@streamingWorld = null
|
||||
@deserializationQueue = null
|
||||
@deserializationQueue = []
|
||||
_.remove @shared.busyAngels, @
|
||||
@abortTimeout = _.delay @fireWorker, @abortTimeoutDuration
|
||||
@aborting = true
|
||||
|
@ -254,7 +254,7 @@ module.exports = class Angel extends CocoClass
|
|||
@initialized = false
|
||||
@work = null
|
||||
@streamingWorld = null
|
||||
@deserializationQueue = null
|
||||
@deserializationQueue = []
|
||||
@hireWorker() if rehire
|
||||
|
||||
hireWorker: ->
|
||||
|
|
|
@ -139,7 +139,8 @@ module.exports = class TomeView extends CocoView
|
|||
onSpellLoaded: (e) ->
|
||||
for spellID, spell of @spells
|
||||
return unless spell.loaded
|
||||
@cast()
|
||||
justBegin = @options.level.isType('game-dev')
|
||||
@cast false, false, justBegin
|
||||
|
||||
onCastSpell: (e) ->
|
||||
# A single spell is cast.
|
||||
|
|
Loading…
Reference in a new issue