- if (IN_FIELD(x, y, max_fieldx, max_fieldy) && field[x][y] == old_element)
- FloodFillLevelExt(x, y, fill_element, max_array_fieldx, max_array_fieldy,
- field, max_fieldx, max_fieldy);
- }
+ // check for stack buffer overflow (should not happen)
+ if (stack_pos >= MAX_LEV_FIELDX * MAX_LEV_FIELDY)
+ Fail("Stack buffer overflow in 'FloodFillLevelExt()'. Please debug.");