1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Merge pull request #4105 from duncanspumpkin/fix_image

Fix Image List
This commit is contained in:
Duncan
2016-07-16 14:17:22 +01:00
committed by GitHub

View File

@@ -99,7 +99,22 @@ static void FreeImageList(uint32 baseImageId, uint32 count)
bool contains = AllocatedListContains(baseImageId, count);
Guard::Assert(contains);
#endif
for (auto it = _freeLists.begin(); it != _freeLists.end(); it++)
{
if (it->BaseId + count == baseImageId)
{
it->Count += count;
return;
}
else if (baseImageId + count == it->BaseId)
{
it->BaseId = baseImageId;
it->Count += count;
return;
}
}
// TODO validate that this was an allocated list
_freeLists.push_back({ baseImageId, count });
}