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] =?UTF-8?q?=E7=AE=80=E5=8C=96=20getItemsByType=20=E6=96=B9?= =?UTF-8?q?=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; }); }; //添加地图