mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
Pad: Use memory card filename from current state
Fixes memory card data getting lost after loading state.
This commit is contained in:
parent
3b68c4028d
commit
b979706417
|
@ -19,6 +19,8 @@ public:
|
||||||
static std::unique_ptr<MemoryCard> Open(std::string_view filename);
|
static std::unique_ptr<MemoryCard> Open(std::string_view filename);
|
||||||
|
|
||||||
const MemoryCardImage::DataArray& GetData() const { return m_data; }
|
const MemoryCardImage::DataArray& GetData() const { return m_data; }
|
||||||
|
const std::string& GetFilename() const { return m_filename; }
|
||||||
|
void SetFilename(std::string filename) { m_filename = std::move(filename); }
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
bool DoState(StateWrapper& sw);
|
bool DoState(StateWrapper& sw);
|
||||||
|
|
|
@ -110,6 +110,7 @@ bool Pad::DoState(StateWrapper& sw)
|
||||||
if (m_memory_cards[i]->GetData() == card_from_state->GetData())
|
if (m_memory_cards[i]->GetData() == card_from_state->GetData())
|
||||||
{
|
{
|
||||||
Log_DevPrintf("Using memory card %u state from save state", i);
|
Log_DevPrintf("Using memory card %u state from save state", i);
|
||||||
|
card_from_state->SetFilename(m_memory_cards[i]->GetFilename());
|
||||||
m_memory_cards[i] = std::move(card_from_state);
|
m_memory_cards[i] = std::move(card_from_state);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue