对GameEvent.insertAfter的参数做空值判断

This commit is contained in:
kuangthree 2023-11-08 22:30:19 +08:00
parent 020be275ed
commit 7b0978d152
1 changed files with 6 additions and 2 deletions

View File

@ -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){