Skip to content

Commit

Permalink
Fix circle break crash by terminating casting if the impetus ceases t…
Browse files Browse the repository at this point in the history
…o exists at it's location (closes #661) (#707)
  • Loading branch information
SamsTheNerd authored Aug 2, 2024
2 parents 1421976 + 3f2c5f4 commit e1ad4b3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ public boolean tick(BlockEntityAbstractImpetus impetus) {
var ctrl = executor.acceptControlFlow(this.currentImage, env, this.enteredFrom, this.currentPos,
executorBlockState, world);

if (env.getImpetus() == null)
return false; //the impetus got removed during the cast and no longer exists in the world. stop casting

if (ctrl instanceof ICircleComponent.ControlFlow.Stop) {
// acceptControlFlow should have already posted the error
halt = true;
Expand Down

0 comments on commit e1ad4b3

Please sign in to comment.