diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/scalpel/darts.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/darts.cpp b/engines/sherlock/scalpel/darts.cpp index 0f3c36420e..476a3071c5 100644 --- a/engines/sherlock/scalpel/darts.cpp +++ b/engines/sherlock/scalpel/darts.cpp @@ -485,13 +485,14 @@ bool Darts::dartHit() { */ int Darts::dartScore(const Common::Point &pt) { Common::Point pos(pt.x - 37, pt.y - 33); + Graphics::Surface &scoreImg = (*_dartImages)[1]._frame; - if (pos.x < 0 || pos.y < 0 || pos.x >= 147 || pt.y >= 132) + if (pos.x < 0 || pos.y < 0 || pos.x >= scoreImg.w || pos.y >= scoreImg.h) // Not on the board return 0; // On board, so get the score from the pixel at that position - int score = *(const byte *)(*_dartImages)[1]._frame.getBasePtr(pos.x, pos.y); + int score = *(const byte *)scoreImg.getBasePtr(pos.x, pos.y); return score; } |