Skip to content

[GEN][ZH] Fix drawable assignment in StealthUpdate::changeVisualDisguise() #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,9 @@ void StealthUpdate::changeVisualDisguise()

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

TheThingFactory->newDrawable( tTemplate );
// TheSuperHackers @fix helmutbuhler 13/04/2025 Fixes missing pointer assignment for the new drawable.
// This originally caused no runtime crash because the new drawable is allocated at the same address as the previously deleted drawable via the MemoryPoolBlob.
draw = TheThingFactory->newDrawable( tTemplate );
if( draw )
{
TheGameLogic->bindObjectAndDrawable(self, draw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,9 @@ void StealthUpdate::changeVisualDisguise()

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

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