diff options
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r-- | scumm/script.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index 759e248784..d33bfb5069 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -518,7 +518,7 @@ int ScummEngine::readVar(uint var) { if (var & 0x8000) { if (_gameId == GID_PAJAMA) { var &= 0xFFF; - checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)"); + checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)"); return _roomVars[var]; } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) || @@ -601,7 +601,7 @@ void ScummEngine::writeVar(uint var, int value) { if (var & 0x8000) { if (_gameId == GID_PAJAMA) { var &= 0xFFF; - checkRange(_numBitVariables, 0, var, "Room variable %d out of range(w)"); + checkRange(_numRoomVariables - 1, 0, var, "Room variable %d out of range(w)"); _roomVars[var] = value; } else if ((_gameId == GID_ZAK256) || (_features & GF_OLD_BUNDLE) || |