From 163c1db6bef55c09a4331788e0321e03b94d2e80 Mon Sep 17 00:00:00 2001 From: Lignum Date: Fri, 19 May 2017 23:37:02 +0200 Subject: [PATCH] Fix some if statements --- .../shared/peripheral/speaker/SpeakerPeripheral.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index 1749f0f2e..98f75ee39 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -148,7 +148,7 @@ public class SpeakerPeripheral implements IPeripheral { if ( arguments.length > 1 ) { - if ( !(arguments[1] instanceof Double) && arguments[1] != null ) // Arg wrong type + if ( arguments[1] != null && !(arguments[1] instanceof Double) ) // Arg wrong type { throw new LuaException( "Expected string, number (optional), number (optional)" ); } @@ -157,7 +157,7 @@ public class SpeakerPeripheral implements IPeripheral { if( arguments.length > 2 ) { - if (!(arguments[1] instanceof Double) && arguments[2] != null) // Arg wrong type + if( arguments[2] != null && !(arguments[2] instanceof Double) ) // Arg wrong type { throw new LuaException("Expected string, number (optional), number (optional)"); } @@ -201,7 +201,7 @@ public class SpeakerPeripheral implements IPeripheral { if( arguments.length > 1 ) { - if( !(arguments[1] instanceof Double) && arguments[1] != null ) // Arg wrong type + if( arguments[1] != null && !(arguments[1] instanceof Double) ) // Arg wrong type { throw new LuaException( "Expected string, number (optional), number (optional)" ); } @@ -212,7 +212,7 @@ public class SpeakerPeripheral implements IPeripheral { if( arguments.length > 2 ) { - if( !(arguments[2] instanceof Double) && arguments[2] != null ) // Arg wrong type + if( arguments[2] != null && !(arguments[2] instanceof Double) ) // Arg wrong type { throw new LuaException( "Expected string, number (optional), number (optional)" ); }