File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior
Generals/Code/GameEngine/Source/GameLogic/Object/Behavior Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -210,11 +210,19 @@ UpdateSleepTime PropagandaTowerBehavior::update( void )
210210 Bool contained = self->getContainedBy () && self->getContainedBy ()->getContainedBy ();
211211#else
212212 Object* container = self->getContainedBy ();
213+ Bool contained = false ;
213214
214- while (container && container->getContainedBy ())
215- container = container->getContainedBy ();
215+ while (container)
216+ {
217+ ContainModuleInterface* containModule = container->getContain ();
218+ if (containModule && containModule->isEnclosingContainerFor (self))
219+ {
220+ contained = true ;
221+ break ;
222+ }
216223
217- Bool contained = (container && container->getContain ()->isEnclosingContainerFor (self));
224+ container = container->getContainedBy ();
225+ }
218226#endif
219227
220228 if (contained)
Original file line number Diff line number Diff line change @@ -212,11 +212,19 @@ UpdateSleepTime PropagandaTowerBehavior::update( void )
212212 Bool contained = self->getContainedBy () && self->getContainedBy ()->getContainedBy ();
213213#else
214214 Object* container = self->getContainedBy ();
215+ Bool contained = false ;
215216
216- while (container && container->getContainedBy ())
217- container = container->getContainedBy ();
217+ while (container)
218+ {
219+ ContainModuleInterface* containModule = container->getContain ();
220+ if (containModule && containModule->isEnclosingContainerFor (self))
221+ {
222+ contained = true ;
223+ break ;
224+ }
218225
219- Bool contained = (container && container->getContain ()->isEnclosingContainerFor (self));
226+ container = container->getContainedBy ();
227+ }
220228#endif
221229
222230 if (contained)
You can’t perform that action at this time.
0 commit comments