Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

Commit

Permalink
Always send terminal state to those listening
Browse files Browse the repository at this point in the history
If the output has changed but the terminal hasn't then we previously
ended up clearing the terminal. This commit ensures the terminal state
is always sent to those listening.

Fixes #145
  • Loading branch information
SquidDev committed Feb 13, 2017
1 parent 0d49c88 commit b01103f
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ public void broadcastState(boolean initial) {
}
}

// We'll have sent the terminal above if terminal limiting isn't enabled. Obviously we only want
// to send it if it has changed
if (Config.Packets.terminalLimiting && hasTerminalChanged()) {
// We'll have sent the terminal above if terminal limiting isn't enabled.
// If terminal limiting is enabled then we obviously need to send the terminal to those interacting with it.
// We send this even if there hasn't been a terminal change for two reasons:
// - Update the computer state of those out of range
// - Correct the terminal for those within range (it will have been cleared by the above packet).
// However this does mean we end up sending packets twice to those within range and interacting with it.
// Thankfully computer state doesn't change too much so this shouldn't be much of an issue.
if (Config.Packets.terminalLimiting) {
ComputerCraftPacket termPacket = createStatePacket();
writeDescription(termPacket.m_dataNBT, true);

Expand Down

0 comments on commit b01103f

Please sign in to comment.