1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-19 09:47:39 +00:00

support preferred wireless modems

This commit is contained in:
kepler155c@gmail.com
2018-11-11 14:45:04 -05:00
parent 4721b6aec1
commit 17d55e75ce
2 changed files with 43 additions and 13 deletions

View File

@@ -28,9 +28,9 @@ function Peripheral.addDevice(deviceList, side)
end
if ptype == 'modem' then
if Peripheral.call(name, 'isWireless') then
ptype = 'wireless_modem'
else
if not Peripheral.call(name, 'isWireless') then
-- ptype = 'wireless_modem'
-- else
ptype = 'wired_modem'
end
end
@@ -57,10 +57,6 @@ function Peripheral.addDevice(deviceList, side)
-- this can randomly fail
pcall(function()
deviceList[name] = Peripheral.wrap(side)
if ptype == 'wireless_modem' and not deviceList.wireless_modem then
-- TODO: fix this
deviceList.wireless_modem = deviceList[name]
end
end)
if deviceList[name] then