1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-03 12:23:53 +00:00

Fix some if statements

This commit is contained in:
Lignum 2017-05-19 23:37:02 +02:00
parent c8697d9158
commit 163c1db6be
No known key found for this signature in database
GPG Key ID: E4DE8F54CA0912BA

View File

@ -148,7 +148,7 @@ public class SpeakerPeripheral implements IPeripheral {
if ( arguments.length > 1 ) 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)" ); throw new LuaException( "Expected string, number (optional), number (optional)" );
} }
@ -157,7 +157,7 @@ public class SpeakerPeripheral implements IPeripheral {
if( arguments.length > 2 ) 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)"); throw new LuaException("Expected string, number (optional), number (optional)");
} }
@ -201,7 +201,7 @@ public class SpeakerPeripheral implements IPeripheral {
if( arguments.length > 1 ) 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)" ); throw new LuaException( "Expected string, number (optional), number (optional)" );
} }
@ -212,7 +212,7 @@ public class SpeakerPeripheral implements IPeripheral {
if( arguments.length > 2 ) 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)" ); throw new LuaException( "Expected string, number (optional), number (optional)" );
} }