Fix #19916. Crash when changing language (#19945)

Issue caused by the unload image function not resetting the image id back to invalid. Also noticed that water wasn't correctly cleaning up.

Fix #19918, #19926, #19927, #19928, #19929, #19931
This commit is contained in:
Duncan 2023-04-15 22:11:01 +01:00 committed by GitHub
parent 7e313d45cd
commit 383642a812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,7 @@ void Object::UnloadImages()
if (_baseImageId != ImageIndexUndefined)
{
GfxObjectFreeImages(_baseImageId, GetImageTable().GetCount());
_baseImageId = ImageIndexUndefined;
}
}

View File

@ -51,6 +51,8 @@ void WaterObject::Unload()
_legacyType.string_idx = 0;
_legacyType.image_id = 0;
_legacyType.palette_index_1 = 0;
_legacyType.palette_index_2 = 0;
}
void WaterObject::DrawPreview(DrawPixelInfo& dpi, int32_t width, int32_t height) const