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:
parent
c8697d9158
commit
163c1db6be
@ -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)" );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user