Skip to content

Commit

Permalink
[sim] DS plugin: Fix off-by-one error when setting alliance station (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 authored Oct 24, 2023
1 parent 8efa586 commit cfc6a47
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ void DSCommPacket::DecodeUDP(std::span<const uint8_t> packet) {
m_lo = packet[1];
// Comm Version is packet 2, ignore
SetControl(packet[3], packet[4]);
SetAlliance(packet[5]);
// DS sends values 0, 1, and 2 for Red, but kUnknown is 0, so the value needs
// to be offset by one
SetAlliance(packet[5] + 1);

// Return if packet finished
if (packet.size() == 6) {
Expand Down

0 comments on commit cfc6a47

Please sign in to comment.