aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/movesens.cpp
diff options
context:
space:
mode:
authorD G Turner2019-11-16 10:10:45 +0000
committerD G Turner2019-11-16 10:10:45 +0000
commit4b6cb6878488577eb0c047e3baea412eb98d02c2 (patch)
tree00c4dfc70f13e9b67b07253878aacba765f6c0af /engines/dm/movesens.cpp
parentcc2973f04f5e46eb1c07ee5ff1e400cf9a85e64e (diff)
downloadscummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.tar.gz
scummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.tar.bz2
scummvm-rg350-4b6cb6878488577eb0c047e3baea412eb98d02c2.zip
DM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
Diffstat (limited to 'engines/dm/movesens.cpp')
-rw-r--r--engines/dm/movesens.cpp48
1 files changed, 27 insertions, 21 deletions
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 1dc36f7979..2eae1cb2fc 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -615,6 +615,7 @@ int16 MovesensMan::getSound(CreatureType creatureType) {
case kDMCreatureTypeLordChaos:
case kDMCreatureTypeLordOrder:
case kDMCreatureTypeGreyLord:
+ default:
return 35;
case kDMCreatureTypeGiggler:
case kDMCreatureTypeStoneGolem:
@@ -969,30 +970,35 @@ void MovesensMan::processRotationEffect() {
switch (_sensorRotationEffect) {
case kDMSensorEffectClear:
case kDMSensorEffectToggle:
- Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
- while ((firstSensorThing.getType() != kDMThingTypeSensor)
- || ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
- firstSensorThing = dungeon.getNextThing(firstSensorThing);
- }
- Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
- Thing lastSensorThing = firstSensor->getNextThing();
- while ((lastSensorThing != _vm->_thingEndOfList)
- && ((lastSensorThing.getType() != kDMThingTypeSensor)
+ {
+ Thing firstSensorThing = dungeon.getSquareFirstThing(_sensorRotationEffMapX, _sensorRotationEffMapY);
+ while ((firstSensorThing.getType() != kDMThingTypeSensor)
+ || ((_sensorRotationEffCell != kDMCellAny) && (firstSensorThing.getCell() != _sensorRotationEffCell))) {
+ firstSensorThing = dungeon.getNextThing(firstSensorThing);
+ }
+ Sensor *firstSensor = (Sensor *)dungeon.getThingData(firstSensorThing);
+ Thing lastSensorThing = firstSensor->getNextThing();
+ while ((lastSensorThing != _vm->_thingEndOfList)
+ && ((lastSensorThing.getType() != kDMThingTypeSensor)
|| ((_sensorRotationEffCell != kDMCellAny) && (lastSensorThing.getCell() != _sensorRotationEffCell)))) {
+ lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ }
+ if (lastSensorThing == _vm->_thingEndOfList)
+ break;
+ dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
+ Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
+ if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
+ lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
+ lastSensorThing = dungeon.getNextThing(lastSensorThing);
+ }
+ firstSensor->setNextThing(lastSensor->getNextThing());
+ lastSensor->setNextThing(firstSensorThing);
}
- if (lastSensorThing == _vm->_thingEndOfList)
- break;
- dungeon.unlinkThingFromList(firstSensorThing, Thing(0), _sensorRotationEffMapX, _sensorRotationEffMapY);
- Sensor *lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
- lastSensorThing = dungeon.getNextThing(lastSensorThing);
- while (((lastSensorThing != _vm->_thingEndOfList) && (lastSensorThing.getType() == kDMThingTypeSensor))) {
- if ((_sensorRotationEffCell == kDMCellAny) || (lastSensorThing.getCell() == _sensorRotationEffCell))
- lastSensor = (Sensor *)dungeon.getThingData(lastSensorThing);
- lastSensorThing = dungeon.getNextThing(lastSensorThing);
- }
- firstSensor->setNextThing(lastSensor->getNextThing());
- lastSensor->setNextThing(firstSensorThing);
+ break;
+ default:
+ break;
}
_sensorRotationEffect = kDMSensorEffectNone;
}