mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-02 15:02:11 +00:00
Savestates: Fix optional_savestate_state use
This commit is contained in:
parent
c7c2baae03
commit
5dbeb68ed2
@ -2364,9 +2364,14 @@ void ppu_thread::serialize_common(utils::serial& ar)
|
||||
|
||||
ar(optional_savestate_state, vr);
|
||||
|
||||
if (optional_savestate_state->data.empty())
|
||||
if (!ar.is_writing())
|
||||
{
|
||||
optional_savestate_state->clear();
|
||||
if (optional_savestate_state->data.empty())
|
||||
{
|
||||
optional_savestate_state->clear();
|
||||
}
|
||||
|
||||
optional_savestate_state->set_reading_state();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,12 +12,16 @@ namespace id_manager
|
||||
template <>
|
||||
bool serialize<std::shared_ptr<utils::serial>>(utils::serial& ar, std::shared_ptr<utils::serial>& o)
|
||||
{
|
||||
if (!o || !ar.is_writing())
|
||||
if (!o)
|
||||
{
|
||||
o.reset();
|
||||
o = std::make_shared<utils::serial>();
|
||||
}
|
||||
|
||||
if (!ar.is_writing())
|
||||
{
|
||||
o->set_reading_state();
|
||||
}
|
||||
|
||||
ar(o->data);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user