From d4ca610d80c60cd9bc3418ed24d1153bb9e05b8b Mon Sep 17 00:00:00 2001 From: gonnavis Date: Fri, 27 May 2022 01:32:36 +0800 Subject: [PATCH 1/2] fix wearupdate event no player bug. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 879456c..18a03f1 100644 --- a/index.js +++ b/index.js @@ -399,7 +399,7 @@ export default e => { let wearing = false; useWear(e => { - const {wear} = e; + const {wear, player} = e; for (const subApp of subApps) { subApp.position.copy(app.position); subApp.quaternion.copy(app.quaternion); @@ -408,6 +408,7 @@ export default e => { subApp.dispatchEvent({ type: 'wearupdate', + player, wear, }); } From 5f6444c444421e51b7680a032338175e589f046d Mon Sep 17 00:00:00 2001 From: gonnavis Date: Fri, 27 May 2022 01:33:28 +0800 Subject: [PATCH 2/2] consider targetApp's vincibility. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 18a03f1..2728b32 100644 --- a/index.js +++ b/index.js @@ -348,7 +348,7 @@ export default e => { bulletPointLight.startTime = performance.now(); bulletPointLight.endTime = bulletPointLight.startTime + bulletSparkTime; - if (targetApp) { + if (targetApp && targetApp.getComponent('vincibility') !== 'invincible') { const localPlayer = useLocalPlayer(); const damage = 2;