[sim] DS plugin: Fix off-by-one error when setting alliance station (#5819)

This commit is contained in:
Gold856
2023-10-24 12:15:40 -04:00
committed by GitHub
parent 8efa586ace
commit cfc6a47f76

View File

@@ -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) {