Fixes crash on Switch/WiiU when attempting to show the ImGui menubar. (#1534)

* Fixes crash on Switch/WiiU when attempting to show the ImGui menubar.

* Fixes weird indentaion on GitHub?
This commit is contained in:
Christopher Leggett 2022-09-20 21:15:15 -04:00 committed by GitHub
parent d2153d601c
commit e1b83b6eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -78,9 +78,11 @@ namespace Ship {
padToBuffer.gyro_y = getGyroY(virtualSlot);
padBuffer.push_front(padToBuffer);
*pad = padBuffer[std::min(padBuffer.size(), (size_t)CVar_GetS32("gSimulatedInputLag", 0))];
while (padBuffer.size() > 6) {
if (pad != nullptr) {
*pad = padBuffer[std::min(padBuffer.size(), (size_t)CVar_GetS32("gSimulatedInputLag", 0))];
}
while (padBuffer.size() > 6) {
padBuffer.pop_back();
}
}