aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2011-12-08 03:31:29 +0000
committerD G Turner2011-12-08 03:31:29 +0000
commitd3a187c298decc7b8e0125a3cdc46162f65ea3bb (patch)
tree9c5bf5e4aba927b49c8fecdc38e96b502b702278
parentc619b8d981393bed9958179ea5d2f0a557d41087 (diff)
downloadscummvm-rg350-d3a187c298decc7b8e0125a3cdc46162f65ea3bb.tar.gz
scummvm-rg350-d3a187c298decc7b8e0125a3cdc46162f65ea3bb.tar.bz2
scummvm-rg350-d3a187c298decc7b8e0125a3cdc46162f65ea3bb.zip
DRACI: Replace usage of 'goto'.
-rw-r--r--engines/draci/walking.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index 9a66c6163a..f1ae769d80 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -729,20 +729,18 @@ Movement WalkingState::transitionBetweenAnimations(Movement previous, Movement n
Movement WalkingState::animationForSightDirection(SightDirection dir, const Common::Point &hero, const Common::Point &mouse, const WalkingPath &path, Movement startingDirection) {
switch (dir) {
+ case kDirectionLeft:
+ return kStopLeft;
+ case kDirectionRight:
+ return kStopRight;
case kDirectionMouse:
if (mouse.x < hero.x) {
return kStopLeft;
} else if (mouse.x > hero.x) {
return kStopRight;
- } else {
- goto defaultCase;
}
- case kDirectionLeft:
- return kStopLeft;
- case kDirectionRight:
- return kStopRight;
+ // fall-through here intentional
default: {
-defaultCase:
// Find the last horizontal direction on the path.
int i = path.size() - 1;
while (i >= 0 && path[i].x == hero.x) {