mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 05:53:39 -04:00
Fixed a bug with playback never quite getting to the end.
This commit is contained in:
parent
6441a753d5
commit
b8d59cb179
2 changed files with 1 additions and 4 deletions
app
|
@ -336,7 +336,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
|
||||
@lastFrame = @currentFrame
|
||||
|
||||
getProgress: -> @currentFrame / @world.frames.length
|
||||
getProgress: -> @currentFrame / Math.max(1, @world.frames.length - 1)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -262,10 +262,7 @@ module.exports = class LevelPlaybackView extends CocoView
|
|||
onFrameChanged: (e) ->
|
||||
if e.progress isnt @lastProgress
|
||||
@currentTime = e.frame / e.world.frameRate
|
||||
# Game will sometimes stop at 29.97, but with only one digit, this is unnecesary.
|
||||
# @currentTime = @totalTime if Math.abs(@totalTime - @currentTime) < 0.04
|
||||
@updatePopupContent() if @timePopup?.shown
|
||||
|
||||
@updateProgress(e.progress, e.world)
|
||||
@updatePlayButton(e.progress)
|
||||
@lastProgress = e.progress
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue