EMI: Fix crash when restarting the game

ResidualVM's EMI patch installs a custom version of system_prefs.loadprefs
which maps config reads to GetResidualVMPreference() calls. The original
system_prefs.cfg is saved and used as source for default values. When
the custom loadprefs function is called a second time (i.e. when using
the New Game option in the main menu) any config read results in an
endless recursion.
This commit is contained in:
Ingo van Lil 2014-01-12 04:09:40 +01:00
parent 434cb0859a
commit 6bb31ac575
2 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ end
--Overwrite stock loadprefs function
system_prefs.loadprefs = function(table, filename)
--avoid installing tag methods repeatedly when starting a new game
if system_prefs.defaults_cfg ~= nil then
return
end
PrintDebug("Function system_prefs.loadprefs modified for ResidualVM loaded")
--save old cfg table as default values