aboutsummaryrefslogtreecommitdiff
path: root/engines/dm
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dm')
-rw-r--r--engines/dm/projexpl.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index 25e0b585d3..3bcd3ca963 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -132,12 +132,16 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
return false;
} else {
int16 associatedThingIndex = _vm->_dungeonMan->getObjectInfoIndex(projectileAssociatedThing);
- if ((projectileThingData->_attack > _vm->getRandomNumber(128))
- && getFlag(_vm->_dungeonMan->_objectInfos[associatedThingIndex].getAllowedSlots(), k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors)) {
+ uint16 associatedAllowedSlots = _vm->_dungeonMan->_objectInfos[associatedThingIndex].getAllowedSlots();
+ int16 iconIndex = _vm->_objectMan->getIconIndex(projectileAssociatedThing);
- int16 iconIndex = _vm->_objectMan->getIconIndex(projectileAssociatedThing);
- if ((projectileAssociatedThingType != k10_JunkThingType) || (iconIndex < k176_IconIndiceJunkIronKey) || (iconIndex > k191_IconIndiceJunkMasterKey))
- return false;
+ if ((projectileThingData->_attack > _vm->getRandomNumber(128))
+ && getFlag(associatedAllowedSlots, k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors)
+ && ( (projectileAssociatedThingType != k10_JunkThingType)
+ || (iconIndex < k176_IconIndiceJunkIronKey)
+ || (iconIndex > k191_IconIndiceJunkMasterKey)
+ )) {
+ return false;
}
}
}