X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=4f0206e36d8b86a21447332f2829f59295bdf67e;hb=d798911a09cd2a58ccb0378f4a94e6d44b3e0039;hp=bfaad2acdd577f844c51428332857eed3b0a9b30;hpb=787be88219f3631b0bb044c16e3cdea4e8351aee;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index bfaad2ac..4f0206e3 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1377,9 +1377,10 @@ void SetBorderElement() } } -void FloodFillLevel(int from_x, int from_y, int fill_element, - short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY], - int max_fieldx, int max_fieldy) +void FloodFillLevelExt(int from_x, int from_y, int fill_element, + int max_array_fieldx, int max_array_fieldy, + short field[max_array_fieldx][max_array_fieldy], + int max_fieldx, int max_fieldy) { int i,x,y; int old_element; @@ -1404,12 +1405,22 @@ void FloodFillLevel(int from_x, int from_y, int fill_element, y = from_y + check[i][1]; if (IN_FIELD(x, y, max_fieldx, max_fieldy) && field[x][y] == old_element) - FloodFillLevel(x, y, fill_element, field, max_fieldx, max_fieldy); + FloodFillLevelExt(x, y, fill_element, max_array_fieldx, max_array_fieldy, + field, max_fieldx, max_fieldy); } safety--; } +void FloodFillLevel(int from_x, int from_y, int fill_element, + short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY], + int max_fieldx, int max_fieldy) +{ + FloodFillLevelExt(from_x, from_y, fill_element, + MAX_LEV_FIELDX, MAX_LEV_FIELDY, field, + max_fieldx, max_fieldy); +} + void SetRandomAnimationValue(int x, int y) { gfx.anim_random_frame = GfxRandom[x][y];