From 7b0978d1523dcab8db2ec87e3155da4e3d02422b Mon Sep 17 00:00:00 2001 From: kuangthree Date: Wed, 8 Nov 2023 22:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9GameEvent.insertAfter=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=81=9A=E7=A9=BA=E5=80=BC=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index 557988b50..5063b5eef 100644 --- a/game/game.js +++ b/game/game.js @@ -31390,14 +31390,18 @@ const next=new lib.element.GameEvent(`${this.name}Inserted`,false); this.next.push(next); next.setContent(content); - Object.entries(map).forEach(entry=>next.set(entry[0],entry[1])); + if(map){ + Object.entries(map).forEach(entry=>next.set(entry[0],entry[1])); + } return next; } insertAfter(content,map){ const next=new lib.element.GameEvent(`${this.name}Inserted`,false); this.after.push(next); next.setContent(content); - Object.entries(map).forEach(entry=>next.set(entry[0],entry[1])); + if(map){ + Object.entries(map).forEach(entry=>next.set(entry[0],entry[1])); + } return next; } backup(skill){