diff --git a/game.js b/game.js index 64e433c..99a9c29 100644 --- a/game.js +++ b/game.js @@ -266,9 +266,7 @@ function Game(id,params){ //获取对象列表 Stage.prototype.getItemsByType = function(type){ return this.items.filter(function(item){ - if(item.type==type){ - return item; - } + return item.type == type; }); }; //添加地图 diff --git a/index.js b/index.js index da1d6f6..59b1b78 100644 --- a/index.js +++ b/index.js @@ -926,7 +926,7 @@ update:function(){ var coord = this.coord; if(!coord.offset){ - if(this.control.orientation!='undefined'){ + if(typeof this.control.orientation != 'undefined'){ if(!map.get(coord.x+_COS[this.control.orientation],coord.y+_SIN[this.control.orientation])){ this.orientation = this.control.orientation; }