mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[sim] DS plugin: Fix off-by-one error when setting alliance station (#5819)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user