aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
authorStrangerke2016-09-24 09:40:01 +0200
committerStrangerke2016-09-24 09:41:56 +0200
commit6ea230af48d98aff3bfab90fb7f67223191a4bde (patch)
tree10cde20f0d48ff85eba9eb3e9292061429f8d0ae /engines/dm
parent3ab3a85657ca1719089df5914230bc74bc2ae926 (diff)
downloadscummvm-rg350-6ea230af48d98aff3bfab90fb7f67223191a4bde.tar.gz
scummvm-rg350-6ea230af48d98aff3bfab90fb7f67223191a4bde.tar.bz2
scummvm-rg350-6ea230af48d98aff3bfab90fb7f67223191a4bde.zip
DM: Fix some CppCheck warnings
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/dungeonman.cpp3
-rw-r--r--engines/dm/gfx.cpp2
-rw-r--r--engines/dm/group.cpp5
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index 9ee86eda90..2886c6c66b 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -638,6 +638,9 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonMaps[i]._doorSet0 = (tmp >> 8) & 0xF;
_dungeonMaps[i]._wallSet = (WallSet)((tmp >> 4) & 0xF);
_dungeonMaps[i]._floorSet = (FloorSet)(tmp & 0xF);
+
+ if (!file)
+ delete dunDataStream;
}
// load column stuff thingy
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index d8d680c6a9..d0748e6610 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -1080,13 +1080,13 @@ void DisplayMan::drawFloorOrnament(uint16 floorOrnOrdinal, ViewFloor viewFloorIn
return;
bool drawFootprints = (getFlag(floorOrnOrdinal, kDMMaskFootprints) ? true : false);
- byte *bitmap;
if (!drawFootprints || clearFlag(floorOrnOrdinal, kDMMaskFootprints)) {
floorOrnOrdinal--;
uint16 floorOrnIndex = floorOrnOrdinal;
int16 nativeBitmapIndex = _currMapFloorOrnInfo[floorOrnIndex].nativeIndice
+ g191_floorOrnNativeBitmapndexInc[viewFloorIndex];
uint16 *coordSets = g206_floorOrnCoordSets[_currMapFloorOrnInfo[floorOrnIndex].coordinateSet][viewFloorIndex];
+ byte *bitmap;
if ((viewFloorIndex == kDMViewFloorD1R) || (viewFloorIndex == kDMViewFloorD2R)
|| (viewFloorIndex == kDMViewFloorD3R)
|| ((floorOrnIndex == k15_FloorOrnFootprints) && _useFlippedWallAndFootprintsBitmap &&
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index 5eb00208c7..4f96befda1 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -525,14 +525,15 @@ uint16 GroupMan::getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 c
}
int16 GroupMan::getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving) {
- bool killedSomeCreatures = false;
- bool killedAllCreatures = true;
_dropMovingCreatureFixedPossCellCount = 0;
if (attack > 0) {
int16 creatureIndex = group->getCount();
uint16 randomAttackSeed = (attack >> 3) + 1;
attack -= randomAttackSeed;
randomAttackSeed <<= 1;
+
+ bool killedSomeCreatures = false;
+ bool killedAllCreatures = true;
do {
int16 outcomeVal = groupGetDamageCreatureOutcome(group, creatureIndex, mapX, mapY, attack + _vm->getRandomNumber(randomAttackSeed), notMoving);
killedAllCreatures = outcomeVal && killedAllCreatures;