Skip to content

Commit 98af79c

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

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 @bugfix helmutbuhler 13/04/2025
759+
// draw was originally not assigned here and potentially caused memory corruption
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 @bugfix helmutbuhler 13/04/2025
1059+
// draw was originally not assigned here and potentially caused memory corruption
1060+
draw = TheThingFactory->newDrawable( tTemplate );
10591061
if( draw )
10601062
{
10611063
TheGameLogic->bindObjectAndDrawable(self, draw);

0 commit comments

Comments
 (0)