Skip to content

Commit 6150321

Browse files
jabbanydbFlower
authored andcommitted
修正逻辑错误, 此处逻辑应该为 先验证是否stime < time 再验证此条弹幕是否能通过filter的验证, 否则当补全validate方法之后会产生让人抓狂的bug。
bug 具体内容: 当我实现完整的validate方法之后, 若按照原来的逻辑, 会执行else 的语句, 但是else 中直接break, 所以并未执行for的第三句话。 所以导致this.position一直未自增
1 parent c64ec9a commit 6150321

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

build/CommentCoreLibrary.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ function CommentFilter(){
667667
* Comment Core Library CommentManager
668668
* @license MIT
669669
* @author Jim Chen
670-
*
670+
*
671671
* Copyright (c) 2014 Jim Chen
672672
*/
673673
var CommentManager = (function() {
@@ -692,7 +692,7 @@ var CommentManager = (function() {
692692
}
693693
return "matrix3d(" + matrix.join(",") + ")";
694694
};
695-
695+
696696
function CommentManager(stageObject){
697697
var __timer = 0;
698698
this._listeners = {};
@@ -839,15 +839,17 @@ var CommentManager = (function() {
839839
}
840840
for(;this.position < this.timeline.length;this.position++){
841841
if(this.options.limit > 0 && this.runline.length > this.limiter) break;
842-
if(this.validate(this.timeline[this.position]) && this.timeline[this.position]['stime']<=time){
843-
this.send(this.timeline[this.position]);
842+
if(this.timeline[this.position]['stime']<=time){
843+
if(this.validate(this.timeline[this.position])){
844+
this.send(this.timeline[this.position]);
845+
}
844846
}else{
845847
break;
846848
}
847849
}
848850
};
849851
CommentManager.prototype.rescale = function(){
850-
852+
851853
};
852854
CommentManager.prototype.send = function(data){
853855
if(data.mode === 8){

0 commit comments

Comments
 (0)