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:
committed by
GitHub
parent
a5de893439
commit
d2e1857733
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user