diff --git a/src/event.cxx b/src/event.cxx index c5a8e29..676ed9c 100644 --- a/src/event.cxx +++ b/src/event.cxx @@ -4638,6 +4638,8 @@ CEvent::ReadInfo () if (file == nullptr) goto error; + SDL_memset (&info, 0, sizeof (info)); + nb = fread (&info, sizeof (DescInfo), 1, file); if (nb < 1) goto error; @@ -4657,7 +4659,11 @@ CEvent::ReadInfo () m_pSound->SetMidiVolume (info.midiVolume); if ((info.majRev == 1 && info.minRev >= 1) || info.majRev >= 2) + { + if (info.language >= static_cast (Language::end)) + info.language = 0; this->SetLanguage (static_cast (info.language)); + } fclose (file); return true; diff --git a/src/event.h b/src/event.h index 31a1616..fb4e1fb 100644 --- a/src/event.h +++ b/src/event.h @@ -84,9 +84,8 @@ enum class Language { fr = 2, de = 3, it = 4, - // Left some space for Korean and Hebrew as I think original translations - // should be first, see issue #23 - pl = 7, + pl = 5, + end, }; class CEvent