mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Merge pull request #6088 from Chaosmeister/develop
prevent infinite loop while fixing invalid research items
This commit is contained in:
@@ -1072,7 +1072,15 @@ void game_fix_save_vars()
|
||||
for (sint32 i = 0; i < MAX_RESEARCH_ITEMS; i++) {
|
||||
rct_research_item *researchItem = &gResearchItems[i];
|
||||
if (researchItem->entryIndex == RESEARCHED_ITEMS_SEPARATOR) continue;
|
||||
if (researchItem->entryIndex == RESEARCHED_ITEMS_END) continue;
|
||||
if (researchItem->entryIndex == RESEARCHED_ITEMS_END)
|
||||
{
|
||||
if (i == MAX_RESEARCH_ITEMS - 1)
|
||||
{
|
||||
(--researchItem)->entryIndex = RESEARCHED_ITEMS_END;
|
||||
}
|
||||
(++researchItem)->entryIndex = RESEARCHED_ITEMS_END_2;
|
||||
break;
|
||||
}
|
||||
if (researchItem->entryIndex == RESEARCHED_ITEMS_END_2) break;
|
||||
if (researchItem->entryIndex & 0x10000) {
|
||||
uint8 entryIndex = researchItem->entryIndex & 0xFF;
|
||||
@@ -1096,7 +1104,6 @@ void game_fix_save_vars()
|
||||
|
||||
// Fix invalid vehicle sprite sizes, thus preventing visual corruption of sprites
|
||||
fix_invalid_vehicle_sprite_sizes();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user