mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
GRIM: Fix the behaviour when trying to set a setup above the upper limit.
Fix #261
This commit is contained in:
parent
6569f26b42
commit
14960da59e
@ -501,7 +501,13 @@ void Set::turnOffLights() {
|
||||
void Set::setSetup(int num) {
|
||||
// Looks like num is zero-based so >= should work to find values
|
||||
// that are out of the range of valid setups
|
||||
if (num >= _numSetups || num < 0) {
|
||||
|
||||
// Quite weird, but this is what the original does when the setup id is above
|
||||
// the upper bound.
|
||||
if (num >= _numSetups)
|
||||
num %= _numSetups;
|
||||
|
||||
if (num < 0) {
|
||||
error("Failed to change scene setup, value out of range");
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user