Skip to content

Commit

Permalink
Fix peripheral.getMethods returning {}
Browse files Browse the repository at this point in the history
I don't even know how this snuck past.

Closes #346
  • Loading branch information
SquidDev committed Jan 14, 2020
1 parent 018ecfb commit 8b1773d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mod properties
mod_version=1.86.1
mod_version=1.86.2

# Minecraft properties
mc_version=1.12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,20 +364,17 @@ public Object[] callMethod( @Nonnull ILuaContext context, int method, @Nonnull O
case 2:
{
// getMethods
String[] methods = null;
ComputerSide side = ComputerSide.valueOfInsensitive( getString( args, 0 ) );
if( side != null )
{
synchronized( m_peripherals )
{
PeripheralWrapper p = m_peripherals[side.ordinal()];
if( p != null )
{
methods = p.getMethods();
}
if( p != null ) return new Object[] { p.getMethods() };
}
}
return methods != null ? new Object[] { new HashMap<>() } : null;

return null;
}
case 3:
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# New features in CC: Tweaked 1.86.2

* Fix peripheral.getMethods returning an empty table

# New features in CC: Tweaked 1.86.1

* Add a help message to the Lua REPL's exit function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
New features in CC: Tweaked 1.86.1
New features in CC: Tweaked 1.86.2

* Add a help message to the Lua REPL's exit function
* Add more MOTD messages. (osmarks)
* GPS requests are now made anonymously (osmarks)
* Minor memory usage improvements to Cobalt VM.

And several bug fixes:
* Fix error when calling `write` with a number.
* Add missing assertion to `io.write`.
* Fix peripheral.getMethods returning an empty table

Type "help changelog" to see the full version history.

0 comments on commit 8b1773d

Please sign in to comment.