args drop returns scala iterator, no need to cast again, toArray will work

closes #3159
This commit is contained in:
payonel 2021-05-11 13:03:41 -07:00
parent a1d1834597
commit 90be0181bc

View File

@ -259,8 +259,7 @@ class DebugCard(host: EnvironmentHost) extends prefab.ManagedEnvironment with De
checkAccess()
val destination = args.checkString(0)
DebugNetwork.getEndpoint(destination).filter(_ != this).foreach{endpoint =>
// Cast to iterable to use Scala's toArray instead of the Arguments' one (which converts byte arrays to Strings).
val packet = Network.newPacket(node.address, destination, 0, args.drop(1).asInstanceOf[java.lang.Iterable[AnyRef]].toArray)
val packet = Network.newPacket(node.address, destination, 0, args.drop(1).toArray)
endpoint.receivePacket(packet)
}
result()