mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Goal states (for the purpose of triggering achievements) are now only saved as having succeeded when the overall level is succeeded.
This commit is contained in:
parent
1889c771f2
commit
5ee1289621
1 changed files with 3 additions and 1 deletions
|
@ -211,10 +211,12 @@ module.exports = class LevelBus extends Bus
|
|||
@changedSessionProperties.state = true
|
||||
@reallySaveSession() # Make sure it saves right away; don't debounce it.
|
||||
|
||||
onNewGoalStates: ({goalStates}) ->
|
||||
onNewGoalStates: (e) ->
|
||||
# TODO: this log doesn't capture when null-status goals are being set during world streaming. Where can they be coming from?
|
||||
goalStates = e.goalStates
|
||||
return console.error("Somehow trying to save null goal states!", newGoalStates) if _.find(newGoalStates, (gs) -> not gs.status)
|
||||
|
||||
return unless e.overallStatus is 'success'
|
||||
newGoalStates = goalStates
|
||||
state = @session.get('state')
|
||||
oldGoalStates = state.goalStates or {}
|
||||
|
|
Loading…
Reference in a new issue