Skip to content

Commit 5638448

Browse files
committed
fix in multiAddOnContain
1 parent cb91723 commit 5638448

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/MultiAddOnContain.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,18 @@ Bool MultiAddOnContain::isPassengerAllowedToFire(ObjectID id) const
341341
return FALSE;
342342

343343
//if (id == INVALID_ID && m_addOnList.size() > 0) {
344-
// return TRUE; // This handles cases where we just check if we can attack at all.
344+
// return TRUE; // This handles cases where we just check if we can attack at all.
345345
//}
346346

347-
// Wait, the portable structures aren't actually contained, so we skip this
348-
//for (std::vector<AddOnSlotData>::iterator it = m_addOnSlots.begin(); it != m_addOnSlots.end(); ) {
349-
// if (*it->portableID == id && id != INVALID_ID) {
350-
// return TRUE; // Portable structures can always fire
351-
// }
352-
//}
347+
// Wait, the portable structures aren't actually contained, so we skip this -- no we don't!
348+
if (id != INVALID_ID)
349+
{
350+
for (Object* addOn : m_addOnList) {
351+
if (addOn->getID() == id) {
352+
return TRUE;
353+
}
354+
}
355+
}
353356

354357
return TransportContain::isPassengerAllowedToFire(id); //extend for everything else
355358
}

0 commit comments

Comments
 (0)