mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Fixes for 0 based joysticks and joystick axes in simulation.
Change-Id: I67608450d0818b38f6d5b5c709190433f2dc5cf5
This commit is contained in:
@@ -70,7 +70,7 @@ void Joystick::InitJoystick(uint32_t numAxisTypes, uint32_t numButtonTypes)
|
||||
joysticks[i] = NULL;
|
||||
joySticksInitialized = true;
|
||||
}
|
||||
joysticks[m_port - 1] = this;
|
||||
joysticks[m_port] = this;
|
||||
|
||||
m_ds = DriverStation::GetInstance();
|
||||
m_axes = new uint32_t[numAxisTypes];
|
||||
@@ -79,11 +79,11 @@ void Joystick::InitJoystick(uint32_t numAxisTypes, uint32_t numButtonTypes)
|
||||
|
||||
Joystick * Joystick::GetStickForPort(uint32_t port)
|
||||
{
|
||||
Joystick *stick = joysticks[port - 1];
|
||||
Joystick *stick = joysticks[port];
|
||||
if (stick == NULL)
|
||||
{
|
||||
stick = new Joystick(port);
|
||||
joysticks[port - 1] = stick;
|
||||
joysticks[port] = stick;
|
||||
}
|
||||
return stick;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user