1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 08:12:53 +01:00

Fix #4793: Inventions list broken

This reverts commit 3f767ed8ff and replaces it with exact check that
doesn't trigger array-bounds GCC warning with `-O3`
This commit is contained in:
Michał Janiszewski
2016-12-04 12:03:32 +01:00
committed by GitHub
parent a5de893439
commit d2e1857733

View File

@@ -419,9 +419,7 @@ static void move_research_item(rct_research_item *beforeItem)
rct_window *w;
rct_research_item *researchItem, draggedItem;
// We only really care about `_editorInventionsListDraggedItem == beforeItem - 1`,
// but this would cause a GCC warning due to -Warray-bounds
if (_editorInventionsListDraggedItem < beforeItem)
if (_editorInventionsListDraggedItem + 1 == beforeItem)
return;
// Back up the dragged item