Skip to content

Commit

Permalink
error handling for short fuse times
Browse files Browse the repository at this point in the history
  • Loading branch information
ForestOfLight committed Sep 19, 2024
1 parent b09d104 commit 0a8c23f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions Canopy [BP]/scripts/src/rules/tntPrimeMaxMomentum.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ world.afterEvents.entitySpawn.subscribe(async (event) => {
const entity = event.entity;
if (await Rule.getValue('dupeTnt')) {
system.runTimeout(() => {
if (!entity.isValid()) return;
correctErrorAndNegateXZVelocity(entity);
applyHardcodedImpulse(entity);
}, 1);
Expand Down
1 change: 1 addition & 0 deletions Canopy [BP]/scripts/src/rules/tntPrimeNoMomentum.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ world.afterEvents.entitySpawn.subscribe(async (event) => {
const entity = event.entity;
if (await Rule.getValue('dupeTnt')) {
system.runTimeout(() => {
if (!entity.isValid()) return;
correctErrorAndNegateXZVelocity(entity);
}, 1);
} else {
Expand Down

0 comments on commit 0a8c23f

Please sign in to comment.