Fixed #259 intermittent hyperspace jump issue

This commit is contained in:
LemADEC 2017-05-12 02:44:08 +02:00
parent 122b1f1049
commit 7d150811f0

View file

@ -121,12 +121,13 @@ public class TileEntityShipController extends TileEntityAbstractInterfaced {
} }
private void setMode(final int mode) { private void setMode(final int mode) {
EnumShipCoreMode[] modes = EnumShipCoreMode.values(); for(EnumShipCoreMode enumShipCoreMode : EnumShipCoreMode.values()) {
if (mode >= 0 && mode <= modes.length) { if (enumShipCoreMode.getCode() == mode) {
this.mode = modes[mode]; this.mode = enumShipCoreMode;
markDirty(); markDirty();
if (WarpDriveConfig.LOGGING_JUMP && hasWorldObj()) { if (WarpDriveConfig.LOGGING_JUMP && hasWorldObj()) {
WarpDrive.logger.info(this + " Mode set to " + this.mode + " (" + this.mode.getCode() + ")"); WarpDrive.logger.info(this + " Mode set to " + this.mode + " (" + this.mode.getCode() + ")");
}
} }
} }
} }