mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 17:02:18 -05:00
Merge pull request #479 from jayant1992/proposed-editor-bugfix
Minor bugfix for freezing editor due to out of bounds frame index
This commit is contained in:
commit
b84c2d301a
1 changed files with 1 additions and 0 deletions
|
@ -502,6 +502,7 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
# Skip some frame updates unless we're playing and not at end (or we haven't drawn much yet)
|
||||
frameAdvanced = (@playing and @currentFrame < @world.totalFrames) or @totalFramesDrawn < 2
|
||||
@currentFrame += @world.frameRate / @options.frameRate if frameAdvanced and @playing
|
||||
@currentFrame = Math.min(@currentFrame, @world.totalFrames - 1)
|
||||
newWorldFrame = Math.floor @currentFrame
|
||||
worldFrameAdvanced = newWorldFrame isnt oldWorldFrame
|
||||
if worldFrameAdvanced
|
||||
|
|
Loading…
Reference in a new issue