Adding condition to CoreTiming state function

because ev->type might be undefined in MODE_READ
This commit is contained in:
John Peterson 2013-05-27 15:38:36 +02:00
parent 2697b8c04f
commit 388ddee685
1 changed files with 4 additions and 1 deletions

View File

@ -170,7 +170,10 @@ void EventDoState(PointerWrap &p, BaseEvent* ev)
// we can't savestate ev->type directly because events might not get registered in the same order (or at all) every time.
// so, we savestate the event's type's name, and derive ev->type from that when loading.
std::string name = event_types[ev->type].name;
std::string name;
if (p.GetMode() != PointerWrap::MODE_READ)
name = event_types[ev->type].name;
p.Do(name);
if (p.GetMode() == PointerWrap::MODE_READ)
{