Skip to content

Commit

Permalink
Fixed crash when moving train from ship to world
Browse files Browse the repository at this point in the history
  • Loading branch information
StewStrong committed Oct 19, 2023
1 parent c82b836 commit 1b862df
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ private void postTick(final CallbackInfo ci) {
if (wingGroupId != -1 && level instanceof final ServerLevel serverLevel) {
final LoadedServerShip ship = VSGameUtilsKt.getShipObjectManagingPos(serverLevel,
VectorConversionsMCKt.toJOML(thisAsAbstractContraptionEntity.position()));
ship.getAttachment(WingManager.class).setWingGroupTransform(wingGroupId, computeContraptionWingTransform());
if (ship != null) {
// This can happen if a player moves a train contraption from ship to world using a wrench
ship.getAttachment(WingManager.class).setWingGroupTransform(wingGroupId, computeContraptionWingTransform());
}
}
}

Expand Down

0 comments on commit 1b862df

Please sign in to comment.