From 78085dcd8d376e6f66f753fa40fc5537ba604d42 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 6 Sep 2016 22:52:58 +0200 Subject: DM: Take Dreammaster's suggestion into account to make it even more readable --- engines/dm/projexpl.cpp | 14 +++++++++----- 1 file 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; } } } -- cgit v1.2.3