mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-11-16 23:04:53 +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
12f2f854a6
commit
b46ad62424
@ -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