Fizzi
2007-09-03 01:40:48
This is just a very minor error in coding, but it makes a big difference on whether it works or not, heh. I don't know if it has been seen yet, but here is the current problem, and then the fix.
Here is the current function.
The problem is with this line:
if (FindDTM(itemx, itemy, dtm, x1, y1, x2, y2)) then
FindDTM is supposed to be (dtm, itemx, itemy, x1, y1, x2, y2).
Just posting this to make the devs aware of the problem.
Here is the current function.
{*******************************************************************************
function ItemCoordsDtm(area: String; dtm: Integer): TPointArray;
By: masquerader
Description: Returns the coordinates of items found with a dtm in an area.
*******************************************************************************}
function ItemCoordsDtm(area: string; dtm: Integer): TPointArray;
var
startx, starty, rowsize, colsize, colnumber, rownumber, col, row: Integer;
x1, y1, x2, y2: Integer;
itemx, itemy: Integer;
i: Integer;
begin
SetArrayLength(Result, 0);
if (CheckArea(area)) then
begin
AreaInfo(area, startx, starty, rowsize, colsize, colnumber, rownumber);
for row := 0 to rownumber - 1 do
for col := 0 to colnumber - 1 do
begin
x1 := startx + col * colsize;
y1 := starty + row * rowsize;
x2 := x1 + colsize;
y2 := y1 + rowsize;
if (FindDTM(itemx, itemy, dtm, x1, y1, x2, y2)) then
begin
i := GetArrayLength(Result);
SetArrayLength(Result, i + 1);
Result[i].x := x1;
Result[i].y := y1;
end;
end;
end;
end;
The problem is with this line:
if (FindDTM(itemx, itemy, dtm, x1, y1, x2, y2)) then
FindDTM is supposed to be (dtm, itemx, itemy, x1, y1, x2, y2).
Just posting this to make the devs aware of the problem.