SuperSpaceEye / Some-Peripherals

MIT License
3 stars 4 forks source link

Connection already has raycasting request #19

Open 19PHOBOSS98 opened 3 months ago

19PHOBOSS98 commented 3 months ago

Hi Space, found this while trying out the Range Goggles. I just started the turtle and this showed up. Restarting the world somehow fixes it:

image

code:

modem = peripheral.find("modem")
goggles = peripheral.find("goggle_link_port")

local DEBUG_TO_DRONE_CHANNEL = 9
local DRONE_TO_DEBUG_CHANNEL = 10

function transmit(cmd,args)
    modem.transmit(DRONE_TO_DEBUG_CHANNEL, DEBUG_TO_DRONE_CHANNEL, 
        {range2=item.distance})
end

while true do
    for k, v in pairs(goggles.getConnected()) do
        local item = v.raycast(300, {0, 0, 1}, false, true, true)
        print(textutils.serialize(item))
    end
    sleep(1)
end

mod version patch1-0.0.12

SuperSpaceEye commented 3 months ago

IIRC if you started a big raycast (either just a very long one or a large batch raycast) and tried to make another raycast while it's being processed, it will return that.

SuperSpaceEye commented 3 months ago

Not sure how to fix it, but I will probably rework the whole system when i return to Some Peripherals.