Skip to content

Commit

Permalink
Fix NPE in Shaft Components
Browse files Browse the repository at this point in the history
  • Loading branch information
jrddunbr committed Aug 6, 2023
1 parent c59c012 commit 8577ea8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/kotlin/mods/eln/mechanical/SimpleShaft.kt
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ abstract class SimpleShaftElement(node: TransparentNode, transparentNodeDescript
var destructing = false
override fun isDestructing() = destructing

init {
val exp = WorldExplosion(this as ShaftElement).machineExplosion()
slowProcessList.add(createShaftWatchdog(this).setDestroys(exp))
}

override val shaftConnectivity: Array<Direction>
get() = arrayOf(front.left(), front.right())

Expand All @@ -220,6 +215,8 @@ abstract class SimpleShaftElement(node: TransparentNode, transparentNodeDescript
// These calls can still change the speed via mergeShaft
shaft.connectShaft(this, it)
}
val exp = WorldExplosion(this as ShaftElement).machineExplosion()
slowProcessList.add(createShaftWatchdog(this).setDestroys(exp))
}

override fun onBreakElement() {
Expand Down

0 comments on commit 8577ea8

Please sign in to comment.