mirror of
https://github.com/zenith391/OCEmu.git
synced 2025-09-30 00:28:05 -04:00
move host id initialization to be called once
This commit is contained in:
parent
beddf124fc
commit
03f5c34607
@ -189,12 +189,6 @@ function modem_host.dispatchPacket(packet)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function modem_host.processPendingMessages()
|
function modem_host.processPendingMessages()
|
||||||
-- computer address seems to be applied late
|
|
||||||
if not modem_host.id then
|
|
||||||
modem_host.id = component.list("computer",true)()
|
|
||||||
assert(modem_host.id)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- do not try to process anything if this machine is not even connected to a message board
|
-- do not try to process anything if this machine is not even connected to a message board
|
||||||
-- not wrong without this, this is a simple optimization
|
-- not wrong without this, this is a simple optimization
|
||||||
if not modem_host.connected then
|
if not modem_host.connected then
|
||||||
@ -336,6 +330,12 @@ function modem_host.connectMessageBoard()
|
|||||||
modem_host.clients = {}
|
modem_host.clients = {}
|
||||||
modem_host.messages = {}
|
modem_host.messages = {}
|
||||||
|
|
||||||
|
-- computer address seems to be applied late
|
||||||
|
if not modem_host.id then
|
||||||
|
modem_host.id = component.list("computer",true)()
|
||||||
|
assert(modem_host.id)
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user