Skip to content

Commit 04b968f

Browse files
authored
bugfix(contain): Fix unit attachments being visible in fog after exiting a GLA Tunnel Network (#1522)
1 parent 5ba1741 commit 04b968f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Contain/TunnelContain.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ void TunnelContain::removeFromContain( Object *obj, Bool exposeStealthUnits )
105105
return;
106106

107107
owningPlayer->getTunnelSystem()->removeFromContain( obj, exposeStealthUnits );
108-
109108
}
110109

111110
//-------------------------------------------------------------------------------------------------
@@ -164,13 +163,20 @@ void TunnelContain::onRemoving( Object *obj )
164163
obj->clearDisabled( DISABLED_HELD );
165164

166165
/// place the object in the world at position of the container m_object
166+
#if RETAIL_COMPATIBLE_CRC
167167
ThePartitionManager->registerObject( obj );
168168
obj->setPosition( getObject()->getPosition() );
169169
if( obj->getDrawable() )
170170
{
171171
obj->setSafeOcclusionFrame(TheGameLogic->getFrame()+obj->getTemplate()->getOcclusionDelay());
172172
obj->getDrawable()->setDrawableHidden( false );
173173
}
174+
#else
175+
// TheSuperHackers @bugfix Now correctly adds the objects to the world without issues with shrouded portable structures.
176+
obj->setPosition(getObject()->getPosition());
177+
obj->setSafeOcclusionFrame(TheGameLogic->getFrame() + obj->getTemplate()->getOcclusionDelay());
178+
addOrRemoveObjFromWorld(obj, TRUE);
179+
#endif
174180

175181
doUnloadSound();
176182
}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ void TunnelContain::removeFromContain( Object *obj, Bool exposeStealthUnits )
105105
return;
106106

107107
owningPlayer->getTunnelSystem()->removeFromContain( obj, exposeStealthUnits );
108-
109108
}
110109

111110

@@ -241,17 +240,22 @@ void TunnelContain::onRemoving( Object *obj )
241240
obj->clearDisabled( DISABLED_HELD );
242241

243242
/// place the object in the world at position of the container m_object
243+
#if RETAIL_COMPATIBLE_CRC
244244
ThePartitionManager->registerObject( obj );
245245
obj->setPosition( getObject()->getPosition() );
246246
if( obj->getDrawable() )
247247
{
248248
obj->setSafeOcclusionFrame(TheGameLogic->getFrame()+obj->getTemplate()->getOcclusionDelay());
249249
obj->getDrawable()->setDrawableHidden( false );
250250
}
251+
#else
252+
// TheSuperHackers @bugfix Now correctly adds the objects to the world without issues with shrouded portable structures.
253+
obj->setPosition(getObject()->getPosition());
254+
obj->setSafeOcclusionFrame(TheGameLogic->getFrame() + obj->getTemplate()->getOcclusionDelay());
255+
addOrRemoveObjFromWorld(obj, TRUE);
256+
#endif
251257

252258
doUnloadSound();
253-
254-
255259
}
256260

257261
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)