aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2011-11-04 21:31:57 +0100
committerathrxx2011-11-04 21:46:34 +0100
commit4f948b3309225dfdda5f78ddffa684decdccb1f4 (patch)
tree8c8b41f74f4da36d73eb19c964a645f6f43ab748
parent1527e7b1b437792b15bd64f3dee0d5c31f55e1ad (diff)
downloadscummvm-rg350-4f948b3309225dfdda5f78ddffa684decdccb1f4.tar.gz
scummvm-rg350-4f948b3309225dfdda5f78ddffa684decdccb1f4.tar.bz2
scummvm-rg350-4f948b3309225dfdda5f78ddffa684decdccb1f4.zip
KYRA: replace invalid memset call and add a warning
-rw-r--r--engines/kyra/lol.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index bba21bb5da..182b734e11 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -896,7 +896,7 @@ void LoLEngine::startupNew() {
_availableSpells[0] = 0;
setupScreenDims();
- memset(_globalScriptVars2, 0x100, 8);
+ Common::set_to(_globalScriptVars2, ARRAYEND(_globalScriptVars2), 0x100);
static const int selectIds[] = { -9, -1, -8, -5 };
assert(_charSelection >= 0);
@@ -993,6 +993,10 @@ void LoLEngine::writeSettings() {
void LoLEngine::readSettings() {
_monsterDifficulty = ConfMan.getInt("monster_difficulty");
+ if (_monsterDifficulty < 0 || _monsterDifficulty > 2) {
+ _monsterDifficulty = CLIP(_monsterDifficulty, 0, 2);
+ warning("LoLEngine: Config file contains invalid difficulty setting.");
+ }
_smoothScrollingEnabled = ConfMan.getBool("smooth_scrolling");
_floatingCursorsEnabled = ConfMan.getBool("floating_cursors");