mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 16:17:57 -05:00
Minor bugfix for freezing editor due to out of bounds frame index
This commit is contained in:
parent
5ec06159a6
commit
db0fc82eb0
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