mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
GLK: ADVSYS: Fix variable range checks
This commit is contained in:
parent
b6542b78fc
commit
1b6ac1a67c
@ -250,12 +250,16 @@ int Game::getActionLocation(int action) const {
|
||||
}
|
||||
|
||||
int Game::getVariable(int variableNum) {
|
||||
assert(variableNum < _variableCount);
|
||||
if (variableNum < 1 || variableNum > _variableCount)
|
||||
error("Invalid ariable number %d", variableNum);
|
||||
|
||||
return READ_LE_UINT16(_variableTable + variableNum * 2);
|
||||
}
|
||||
|
||||
void Game::setVariable(int variableNum, int value) {
|
||||
assert(variableNum < _variableCount);
|
||||
if (variableNum < 1 || variableNum > _variableCount)
|
||||
error("Invalid ariable number %d", variableNum);
|
||||
|
||||
WRITE_LE_UINT16(_variableTable + variableNum * 2, value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user