mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 20:20:30 +00:00
Send the original rednet message to the current computer
We were incorrectly enquing the modem payload, not the underlying rednet message. Closes #1308.
This commit is contained in:
parent
da7a50368d
commit
9873ccfa0d
@ -193,7 +193,7 @@ function send(recipient, message, protocol)
|
||||
local sent = false
|
||||
if recipient == os.getComputerID() then
|
||||
-- Loopback to ourselves
|
||||
os.queueEvent("rednet_message", os.getComputerID(), message_wrapper, protocol)
|
||||
os.queueEvent("rednet_message", os.getComputerID(), message, protocol)
|
||||
sent = true
|
||||
else
|
||||
-- Send on all open modems, to the target and to repeaters
|
||||
|
@ -37,6 +37,14 @@ describe("The rednet library", function()
|
||||
expect.error(rednet.send, nil):eq("bad argument #1 (expected number, got nil)")
|
||||
expect.error(rednet.send, 1, nil, false):eq("bad argument #3 (expected string, got boolean)")
|
||||
end)
|
||||
|
||||
it("queues an event on the current computer", function()
|
||||
rednet.send(os.getComputerID(), "Test message")
|
||||
local id, message = rednet.receive(1.0)
|
||||
|
||||
expect(id):eq(os.getComputerID())
|
||||
expect(message):eq("Test message")
|
||||
end)
|
||||
end)
|
||||
|
||||
describe("rednet.broadcast", function()
|
||||
|
Loading…
Reference in New Issue
Block a user