Skip to content

Commit 388879e

Browse files
Maullerhelmutbuhler
authored andcommitted
[GEN][ZH] Fix drawable assignment in StealthUpdate::changeVisualDisguise() (#730)
Co-authored-by: Helmut Buhler <buhler@8gadgetpack.net>
1 parent 7c1b1ac commit 388879e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,9 @@ void StealthUpdate::changeVisualDisguise()
755755

756756
const ThingTemplate *tTemplate = self->getTemplate();
757757

758-
TheThingFactory->newDrawable( tTemplate );
758+
// TheSuperHackers @fix helmutbuhler 13/04/2025 Fixes missing pointer assignment for the new drawable.
759+
// This originally caused no runtime crash because the new drawable is allocated at the same address as the previously deleted drawable via the MemoryPoolBlob.
760+
draw = TheThingFactory->newDrawable( tTemplate );
759761
if( draw )
760762
{
761763
TheGameLogic->bindObjectAndDrawable(self, draw);

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,9 @@ void StealthUpdate::changeVisualDisguise()
10551055

10561056
const ThingTemplate *tTemplate = self->getTemplate();
10571057

1058-
TheThingFactory->newDrawable( tTemplate );
1058+
// TheSuperHackers @fix helmutbuhler 13/04/2025 Fixes missing pointer assignment for the new drawable.
1059+
// This originally caused no runtime crash because the new drawable is allocated at the same address as the previously deleted drawable via the MemoryPoolBlob.
1060+
draw = TheThingFactory->newDrawable( tTemplate );
10591061
if( draw )
10601062
{
10611063
TheGameLogic->bindObjectAndDrawable(self, draw);

0 commit comments

Comments
 (0)