Optimization for not rebuilding LevelSession defaults once a second to set playtime.

This commit is contained in:
Nick Winter 2014-10-07 10:06:41 -07:00
parent 67ed73a01f
commit ef3edfcc08

View file

@ -46,7 +46,7 @@ module.exports = class LevelBus extends Bus
incrementSessionPlaytime: =>
if @playerIsIdle then return
@changedSessionProperties.playtime = true
@session.set('playtime', @session.get('playtime', true) + 1)
@session.set('playtime', (@session.get('playtime') ? 0) + 1)
onPoint: ->
return true unless @session?.get('multiplayer')