Fix issue with 'auto' controller setting (#1548)

* Fix issue with 'auto' controller setting

* Combine inputs rather than overwrite for auto setting

* Swap condition checking for zeroed pads
This commit is contained in:
Garrett Cox 2022-09-21 20:29:16 -05:00 committed by GitHub
parent 3d0d97d6b5
commit ec2222347e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,14 @@ namespace Ship {
padBuffer.push_front(padToBuffer);
if (pad != nullptr) {
*pad = padBuffer[std::min(padBuffer.size() - 1, (size_t)CVar_GetS32("gSimulatedInputLag", 0))];
auto &padFromBuffer = padBuffer[std::min(padBuffer.size() - 1, (size_t)CVar_GetS32("gSimulatedInputLag", 0))];
pad->button |= padFromBuffer.button;
if (pad->stick_x == 0) pad->stick_x = padFromBuffer.stick_x;
if (pad->stick_y == 0) pad->stick_y = padFromBuffer.stick_y;
if (pad->gyro_x == 0) pad->gyro_x = padFromBuffer.gyro_x;
if (pad->gyro_y == 0) pad->gyro_y = padFromBuffer.gyro_y;
if (pad->right_stick_x == 0) pad->right_stick_x = padFromBuffer.right_stick_x;
if (pad->right_stick_y == 0) pad->right_stick_y = padFromBuffer.right_stick_y;
}
while (padBuffer.size() > 6) {