From 4677645b2f8021f728368355893ab531ef472b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E5=B9=B3?= <32758131+NameWjp@users.noreply.github.com> Date: Thu, 3 Dec 2020 11:34:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=AE=80=E5=8C=96=20getItemsByType=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; }); }; //添加地图 From 1b2ea4eb81ab29e95ef4978929e689885a73c070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E5=B9=B3?= <32758131+NameWjp@users.noreply.github.com> Date: Fri, 4 Dec 2020 09:48:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 50e613e..76bbe3d 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; }