diff options
author | Paul Gilbert | 2015-05-18 19:15:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-18 19:15:17 -0400 |
commit | 59993fdc74afad7b210da7849f8ce25631153201 (patch) | |
tree | 8556f92c4ea172736bae83c5bc538c5658bad709 /engines/sherlock/scalpel | |
parent | 46293735c4e10d654d6195fce7781782f1024b26 (diff) | |
download | scummvm-rg350-59993fdc74afad7b210da7849f8ce25631153201.tar.gz scummvm-rg350-59993fdc74afad7b210da7849f8ce25631153201.tar.bz2 scummvm-rg350-59993fdc74afad7b210da7849f8ce25631153201.zip |
SHERLOCK: Replace magic numbers with enums and constants
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r-- | engines/sherlock/scalpel/darts.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/sherlock/scalpel/darts.cpp b/engines/sherlock/scalpel/darts.cpp index 6da8d6848e..29b67216b9 100644 --- a/engines/sherlock/scalpel/darts.cpp +++ b/engines/sherlock/scalpel/darts.cpp @@ -44,9 +44,10 @@ enum { DART_COL_FORE = 5, PLAYER_COLOR = 11 }; +#define OPPONENTS_COUNT 4 -const char *const OPPONENT_NAMES[5] = { - "Skipper", "Willy", "Micky", "Tom", "Bartender" +const char *const OPPONENT_NAMES[OPPONENTS_COUNT] = { + "Skipper", "Willy", "Micky", "Tom" }; /*----------------------------------------------------------------*/ @@ -118,7 +119,7 @@ void Darts::playDarts() { if (playerNumber == 0) { screen.print(Common::Point(DART_INFO_X, DART_INFO_Y + 30), PLAYER_COLOR, "Holmes Wins!"); - if (_level < 4) + if (_level < OPPONENTS_COUNT) setFlagsForDarts(318 + _level); } else { screen.print(Common::Point(DART_INFO_X, DART_INFO_Y + 30), PLAYER_COLOR, "%s Wins!", _opponent.c_str()); @@ -210,7 +211,7 @@ void Darts::initDarts() { _computerPlayer = 2; } else { // Check flags for opponents - for (int idx = 0; idx < 4; ++idx) { + for (int idx = 0; idx < OPPONENTS_COUNT; ++idx) { if (_vm->readFlags(314 + idx)) _level = idx; } |