diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/map.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/gob/map.h b/engines/gob/map.h index 4a63e84a63..0593c663cc 100644 --- a/engines/gob/map.h +++ b/engines/gob/map.h @@ -152,6 +152,9 @@ public: if (!_passMap) return 0; + if ((x < 0) || (y < 0) || (x >= _mapWidth) || (y >= _mapHeight)) + return 0; + return _passMap[y * _mapWidth + x]; } @@ -159,6 +162,9 @@ public: if (!_passMap) return; + if ((x < 0) || (y < 0) || (x >= _mapWidth) || (y >= _mapHeight)) + return; + _passMap[y * _mapWidth + x] = pass; } @@ -184,6 +190,9 @@ public: if (!_passMap) return 0; + if ((x < 0) || (y < 0) || (x >= _mapWidth) || (y >= _mapHeight)) + return 0; + if (heightOff == -1) heightOff = _passWidth; return _passMap[y * heightOff + x]; @@ -193,6 +202,9 @@ public: if (!_passMap) return; + if ((x < 0) || (y < 0) || (x >= _mapWidth) || (y >= _mapHeight)) + return; + if (heightOff == -1) heightOff = _passWidth; _passMap[y * heightOff + x] = pass; |