65 begin |
65 begin |
66 if not doSet then |
66 if not doSet then |
67 begin |
67 begin |
68 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
68 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
69 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
69 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
70 if (Land[y + dy, i] > 0) then dec(Land[y + dy, i]); // check > 0 because explosion can erase collision data |
70 if (Land[y + dy, i] > 0) and (Land[y + dy, i] < 256) then dec(Land[y + dy, i]); // check > 0 because explosion can erase collision data |
71 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
71 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
72 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
72 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
73 if (Land[y - dy, i] > 0) then dec(Land[y - dy, i]); |
73 if (Land[y - dy, i] > 0) and (Land[y - dy, i] < 256) then dec(Land[y - dy, i]); |
74 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
74 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
75 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
75 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
76 if (Land[y + dx, i] > 0) then dec(Land[y + dx, i]); |
76 if (Land[y + dx, i] > 0) and (Land[y + dx, i] < 256) then dec(Land[y + dx, i]); |
77 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
77 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
78 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
78 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
79 if (Land[y - dx, i] > 0) then dec(Land[y - dx, i]); |
79 if (Land[y - dx, i] > 0) and (Land[y - dx, i] < 256) then dec(Land[y - dx, i]); |
80 end else |
80 end else |
81 begin |
81 begin |
82 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
82 if ((y + dy) and LAND_HEIGHT_MASK) = 0 then |
83 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do inc(Land[y + dy, i]); |
83 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
|
84 if (Land[y + dy, i] < 256) then |
|
85 inc(Land[y + dy, i]); |
84 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
86 if ((y - dy) and LAND_HEIGHT_MASK) = 0 then |
85 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do inc(Land[y - dy, i]); |
87 for i:= max(x - dx, 0) to min(x + dx, LAND_WIDTH - 1) do |
|
88 if (Land[y - dy, i] < 256) then |
|
89 inc(Land[y - dy, i]); |
86 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
90 if ((y + dx) and LAND_HEIGHT_MASK) = 0 then |
87 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do inc(Land[y + dx, i]); |
91 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
|
92 if (Land[y + dx, i] < 256) then |
|
93 inc(Land[y + dx, i]); |
88 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
94 if ((y - dx) and LAND_HEIGHT_MASK) = 0 then |
89 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do inc(Land[y - dx, i]); |
95 for i:= max(x - dy, 0) to min(x + dy, LAND_WIDTH - 1) do |
|
96 if (Land[y - dx, i] < 256) then |
|
97 inc(Land[y - dx, i]); |
90 end |
98 end |
91 end; |
99 end; |
92 |
100 |
93 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); |
101 procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); |
94 var dx, dy, d: LongInt; |
102 var dx, dy, d: LongInt; |