Skip to content

Commit 8248ab2

Browse files
Merge pull request #355 from millennIumAMbiguity/1.18.x/fix-349
fixed #349
2 parents 763dc41 + 8cb7f53 commit 8248ab2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

common/src/main/kotlin/org/valkyrienskies/eureka/gui/shiphelm/ShipHelmScreen.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ class ShipHelmScreen(handler: ShipHelmScreenMenu, playerInventory: Inventory, te
5858
}
5959

6060
private fun updateButtons() {
61-
pos = (Minecraft.getInstance().hitResult as? BlockHitResult)?.blockPos
62-
ship = pos?.let { Minecraft.getInstance().level?.getShipManagingPos(it) }
61+
val newPos = (Minecraft.getInstance().hitResult as? BlockHitResult)?.blockPos
62+
if (newPos != null){
63+
pos = newPos
64+
}
65+
val newShip = pos?.let { Minecraft.getInstance().level?.getShipManagingPos(it) }
66+
if (newShip != null){
67+
ship = newShip
68+
}
6369

6470
val isLookingAtShip = ship != null
6571

0 commit comments

Comments
 (0)