mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-04-19 17:16:08 +08:00
fix: 捕捉 & 插件
This commit is contained in:
parent
284a16757b
commit
b1a28b6b3d
@ -325,10 +325,10 @@ core.prototype._loadPluginAsync = async function () {
|
||||
plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1
|
||||
)) {
|
||||
try {
|
||||
value.call(plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1);
|
||||
value?.call(plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1);
|
||||
} catch (e) {
|
||||
console.error(`Plugin '${key}' init fail. `);
|
||||
throw e;
|
||||
console.error(`Plugin '${key}' init failed.`);
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1063,9 +1063,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
if (v.x === x + dx * 2 && v.y === y + dy * 2) {
|
||||
const loc = `${x + dx},${y + dy}`;
|
||||
this.setMapDamage(damage, loc, 0);
|
||||
damage[loc].ambush = damage[loc].ambush ?? [];
|
||||
damage[loc].ambush.push(this);
|
||||
}
|
||||
damage[loc].ambush = damage[loc].ambush ?? [];
|
||||
damage[loc].ambush.push(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -385,12 +385,17 @@ class MPlugin {
|
||||
|
||||
static init() {
|
||||
for (const [key, data] of Object.entries(this.plugins)) {
|
||||
if (data.type === 'content') {
|
||||
data.init?.(key, data.data);
|
||||
} else {
|
||||
data.data = data.init!(key);
|
||||
try {
|
||||
if (data.type === 'content') {
|
||||
data.init?.(key, data.data);
|
||||
} else {
|
||||
data.data = data.init!(key);
|
||||
}
|
||||
this.pluginData[key] = data.data;
|
||||
} catch (e) {
|
||||
console.error(`Plugin ${key} init failed.`);
|
||||
console.error(e);
|
||||
}
|
||||
this.pluginData[key] = data.data;
|
||||
}
|
||||
this.inited = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user