Input: Assign profile name correctly on save (#1217)

This commit is contained in:
goeiecool9999 2024-05-25 01:48:53 +02:00 committed by GitHub
parent 149fe10a4e
commit aadd2f4a1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -472,15 +472,12 @@ bool InputManager::save(size_t player_index, std::string_view filename)
emulated_controller->type_string()
}.c_str());
if(!is_default_file)
emulated_controller->m_profile_name = std::string{filename};
if (emulated_controller->has_profile_name())
emulated_controller_node.append_child("profile").append_child(pugi::node_pcdata).set_value(
emulated_controller->get_profile_name().c_str());
else if (!is_default_file)
{
emulated_controller->m_profile_name = std::string{filename};
emulated_controller_node.append_child("profile").append_child(pugi::node_pcdata).set_value(
emulated_controller->get_profile_name().c_str());
}
// custom settings
emulated_controller->save(emulated_controller_node);