diff --git a/src/procedures.c b/src/procedures.c index 372d2fb..e7385de 100644 --- a/src/procedures.c +++ b/src/procedures.c @@ -579,6 +579,8 @@ uint8_t makeBlockChange (short x, uint8_t y, short z, uint8_t block) { // which naturally appends the chest to the end if a gap isn't found. int last_real_entry = first_gap - 1; for (int i = first_gap; i <= block_changes_count + 15; i ++) { + if (i >= MAX_BLOCK_CHANGES) break; // No more space, trigger failBlockChange + if (block_changes[i].block != 0xFF) { last_real_entry = i; continue;