mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 12:17:17 -04:00
Fixed redstone card T2 in servers, closes #680.
Fixed potential NPE in descriptor packet generation for computer cases. Ignore bad pwchar input (zero length strings).
This commit is contained in:
parent
1973ffa6cc
commit
ba27aab3bb
@ -126,7 +126,7 @@ function term.read(history, dobreak, hint, pwchar)
|
||||
end
|
||||
local hintCache, hintIndex
|
||||
|
||||
if pwchar then
|
||||
if pwchar and unicode.len(pwchar) > 0 then
|
||||
pwchar = unicode.sub(pwchar, 1, 1)
|
||||
end
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package li.cil.oc.common.inventory
|
||||
|
||||
import li.cil.oc.OpenComputers
|
||||
import li.cil.oc.api
|
||||
import li.cil.oc.api.Driver
|
||||
import li.cil.oc.api.driver.EnvironmentHost
|
||||
import li.cil.oc.api.driver.{Item => ItemDriver}
|
||||
@ -59,6 +60,8 @@ trait ComponentInventory extends Inventory with network.Environment {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Make sure our node is connected.
|
||||
api.Network.joinNewNetwork(node)
|
||||
components collect {
|
||||
case Some(component) => connectItemNode(component.node)
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB
|
||||
|
||||
def hasAbstractBusCard = servers exists {
|
||||
case Some(server) => server.machine.isRunning && server.inventory.items.exists {
|
||||
case Some(stack) => DriverAbstractBusCard.worksWith(stack, getClass)
|
||||
case Some(stack) => DriverAbstractBusCard.worksWith(stack, server.getClass)
|
||||
case _ => false
|
||||
}
|
||||
case _ => false
|
||||
@ -115,7 +115,7 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB
|
||||
|
||||
def hasRedstoneCard = servers exists {
|
||||
case Some(server) => server.machine.isRunning && server.inventory.items.exists {
|
||||
case Some(stack) => DriverRedstoneCard.worksWith(stack, getClass)
|
||||
case Some(stack) => DriverRedstoneCard.worksWith(stack, server.getClass)
|
||||
case _ => false
|
||||
}
|
||||
case _ => false
|
||||
|
Loading…
x
Reference in New Issue
Block a user