mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 06:15:38 +00:00
Pad: Fix controller state not being ignored in state load
This commit is contained in:
parent
53f81d067a
commit
125d104df4
|
@ -54,6 +54,8 @@ bool Pad::DoState(StateWrapper& sw)
|
|||
ControllerType state_controller_type = controller_type;
|
||||
sw.Do(&state_controller_type);
|
||||
|
||||
if (g_settings.load_devices_from_save_states)
|
||||
{
|
||||
if (controller_type != state_controller_type)
|
||||
{
|
||||
if (g_settings.load_devices_from_save_states)
|
||||
|
@ -76,7 +78,8 @@ bool Pad::DoState(StateWrapper& sw)
|
|||
else
|
||||
{
|
||||
g_host_interface->AddFormattedOSDMessage(
|
||||
10.0f, g_host_interface->TranslateString("OSDMessage", "Ignoring mismatched controller type %s in port %u."),
|
||||
10.0f,
|
||||
g_host_interface->TranslateString("OSDMessage", "Ignoring mismatched controller type %s in port %u."),
|
||||
Settings::GetControllerTypeName(state_controller_type), i + 1u);
|
||||
|
||||
// we still need to read the save state controller state
|
||||
|
@ -99,6 +102,20 @@ bool Pad::DoState(StateWrapper& sw)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// we still need to read the save state controller state
|
||||
if (state_controller_type != ControllerType::None)
|
||||
{
|
||||
std::unique_ptr<Controller> dummy_controller = Controller::Create(state_controller_type, i);
|
||||
if (dummy_controller)
|
||||
{
|
||||
if (!sw.DoMarker("Controller") || !dummy_controller->DoState(sw))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool card_present = static_cast<bool>(m_memory_cards[i]);
|
||||
sw.Do(&card_present);
|
||||
|
|
Loading…
Reference in a new issue